title: Fetch data in flat list from Firebase Real Time Database
body: <p>I have a structure of data i want to fetch and display in a Flat List here is my data.</p>
  
  <pre><code>-Lt10FlMt0xtru36Ztmb
                    name : "Hello"
  -Lt0pdC5Ikwd-ZWNBiYJ
                    name : "Coke"
  -Lt0paPi_-zkCelfoisM
                    name : "Pespsi"
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>  readUserData = () =&gt; {
  
          firebase.database().ref('Brands/').once('value').then((snapshot) =&gt; {
              console.log(snapshot.val())
              const userdata = snapshot.val();
  
              //  Alert.alert("Helo" , userdata);
              this.setState({
                getListbrands : userdata
  
              })
              Alert.alert("Data" , JSON.stringify(this.state.getListbrands))
  
  
          });
  
      }
  </code></pre>
  
  <p>and here i am setting data in Flat list but it is not showing any thing please guide.</p>
  
  <pre><code>{
    this.state.getListbrands &amp;&amp;
    &lt;FlatList
    data={this.state.getListbrands}
    keyExtractor={(a, b) =&gt; b.toString()}
    renderItem={({ item }) =&gt; (
      &lt;Text style={{color:'#000'}}&gt;{item.name}&lt;/Text&gt;
    )}
  
  /&gt;
  }
  </code></pre>