title: React Native - state is returning null after setting state
body: <p>I'm very much new to react native currently i'm building small app for just getting an idea about this. I'm facing an issue in mapping the data from API. This is the json response returning from the api</p>
  <p><code>{&quot;data&quot;:[{&quot;digit&quot;:300,&quot;countsum&quot;:&quot;52&quot;},{&quot;digit&quot;:301,&quot;countsum&quot;:&quot;102&quot;},{&quot;digit&quot;:302,&quot;countsum&quot;:&quot;27&quot;},{&quot;digit&quot;:303,&quot;countsum&quot;:&quot;201&quot;},{&quot;digit&quot;:500,&quot;countsum&quot;:&quot;101&quot;}]}</code></p>
  <p>When i tried to map this data i'm facing some issues. I stored the response from API to the state and when i tried to display the state data using <code>map</code> function it's showing the state value is null. This the code i tried till now</p>
  <pre><code>const [listdata, setListData] = useState(null)
  useEffect(() =&gt; {
      // Run! Like go get some data from an API.
      getListData();
  }, []);
  
  const getListData = async () =&gt; {
      const token = await AsyncStorage.getItem(&quot;@userToken&quot;)
      axios
          .get(constants.BASE_URL + &quot;getlist?token=&quot; +token)
          .then(response =&gt; setListData(response.data))
          .catch(error =&gt; {
            console.log(error);
          });
          listdata.map(item =&gt; &lt;Text&gt;{item.digit}&lt;/Text&gt;)
    }
  </code></pre>