title: How do i get the status of my response when using fetch in react-native?
body: <p>I am making Log In page for my react native application. My api sends different response when my username and password are valid and invalid. So I want to track and save the status of my response in some state variable and then later perform function accordingly. Please suggest me way to do that.</p>
  
  <pre><code>  doSignUp() {
     console.log("inside post api");
     fetch('MyApiUrl', {
        method: 'POST',
        headers: {
                   'Accept': 'application/json',
                   'Content-Type': 'application/json',
  
                  },
  
  
        body: JSON.stringify({
        password: this.state.password,
        email:this.state.email,
        name: this.state.firstname,
        last_name :this.state.last_name,
        mobile:this.state.mobile,
        ssn:"2222222"
  
       })
        }).then((response) =&gt; {console.log('response:',response.status);
               response.json()}
          .then((responseData) =&gt; {
                                  console.log("inside responsejson");
                                  console.log('response object:',responseData)
                                  console.log('refresh token:',responseData[0].token.refresh_token)
                                  console.log('access token:',responseData[0].token.access_token);
  
  
  
           }).done();
  </code></pre>
  
  <p>}</p>