title: How to display data from a firebase firestore in React Native
body: <p>For the Life of me, I cannot get this to render the data that I pull from the database.</p>
  <p>Here is the code</p>
  <pre><code>function assetList(){
    const [assetL, setAssetL] = useState([]);
    const [errors, setErrors] = useState(&quot;&quot;);
  
    const getAssets = async () =&gt;{
      try{
        const list = [];
        console.log(&quot;Break&quot;);
        db.collection(&quot;assets&quot;).get().then(function(querySnapshot){
          querySnapshot.forEach(function(doc){
              list.push(doc.data());
          });
        });
        //problem
        setAssetL([...list]);
        //problem
        console.log(&quot;list&quot;);
        console.log(list);
        console.log(&quot;AssetL&quot;);
        console.log
      } catch (e) {
        setErrors(&quot;Failed To Load Data&quot;);
      }
    };
     useEffect(() =&gt; {
       getAssets();
     }, []);
     console.log(assetL);
  
    return(
      &lt;SafeAreaView style = {styles.Heading}&gt;
        &lt;View style = {styles.Heading}&gt;
          &lt;Text style = {styles.headText}&gt;Asset List&lt;/Text&gt;
        &lt;/View&gt;
          &lt;FlatList
          data = {assetL}
          renderItem={({item}) =&gt; &lt;Text&gt;{item.default}&lt;/Text&gt;}
          /&gt;
      &lt;/SafeAreaView&gt;
    );
  
  }
  </code></pre>
  <p>I have narrowed down to at least the most pressing issue, other than my jank way of throwing this page of the app together, is that the setAssetL isnt actually setting the assetL const. Can anyone explain why this is happening and how to fix it?</p>