title: react-native. Reference Error value is not defined
body: <p>I'm having a problem setting a state in react-native. I can console.log the value just fine but when I call setState() I get Reference error 'targetSpreadsheet' is not defined.</p>
  
  <p>This is in following function</p>
  
  <pre><code>getCategories = (file) =&gt; {
          console.log(this.state.targetSpreadsheet); // works fine
          this.setState({targetSpreadsheet: file});  // targetSpreadsheet is not defined.
  }
  </code></pre>
  
  <p>And a picker that calls it</p>
  
  <pre><code>  &lt;SimplePicker
      ref={'picker2'}
      options={this.state.spreadsheetNames}
      onSubmit={(option) =&gt; {
        for(var i = 0; i &lt; this.state.spreadsheets.files.length; i++){
          if(this.state.spreadsheets.files[i].name === option){
            let file = this.state.spreadsheets.files[i];
            this.getCategories(file);
            break;
          }
        }
      }}
    /&gt;
  </code></pre>
  
  <p>EDIT</p>
  
  <p>constructor</p>
  
  <pre><code>  constructor(props){
      super(props);
      this.state = {
        targetSpreadsheet: ''
      }
  
      this.getCategories = this.getCategories.bind(this);
    }
  </code></pre>