title: undefined is not an object react-native
body: <p>I am having a problem with setting a state to data from fetch API response    </p>
  
  <pre><code>render() {
      function getCode(text) {
        fetch('url', {
          method: 'POST',
          headers: {
            Accept: 'application/json',
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({
            "telephone": text, 
            "password": "123123"
          })
        }).then(response =&gt; response.json())
        .then(response =&gt; {
          console.log(this.state.text)
          console.log(this.state.uid)
  
          this.setState({uid : response["data"]["telephone"]})
          console.log(this.state.uid)
        // this.setState({uid: response["data"]["telephone"]})
        // console.log(this.state.uid); 
      })
    }
  </code></pre>
  
  <p>here is my constructor </p>
  
  <pre><code>constructor(props) {
     super(props);
     this.state = {
        text: '',
        uid: ''
     }
  }
  </code></pre>
  
  <p>So I am just sending a request, and need to save response inside of the state, but instead, I am getting an error: </p>
  
  <blockquote>
    <p>TypeError: undefined is not an object (evaluating
    '_this2.state.text')]</p>
  </blockquote>
  
  <p>Code lines which is commented are my attempts to fix it.</p>
  
  <p>UPD 1:
  here is response from APi</p>
  
  <pre><code>{"data":{"telephone":["Some data"]}}
  </code></pre>