title: React Native : Access Component state inside a static function
body: <p>I have a component defined like this </p>
  
  <pre><code>export class A extends Component{
     constructor(props){
       this.state = {
          scene:0
       }
     }
    static changeScene(scene){
       this.setState({scene:scene})
    }
  }
  </code></pre>
  
  <p>I want to call change scene from anywhere using <code>A.changeScene(sceneVal)</code>
    to change the scene in A. the problem is i can't access this.setState i got this error <code>Unhandled JS Exception: this.setState is not a function.</code></p>
  
  <p>I am sure that the A component is already mounted. I can bypass this error by defining a global variable <code>var self = null;</code> and inside the constructor  <code>self =  this</code> in the constructor but i want a better way to rosolve this problem </p>