title: How to display data using FlatList in react native?
body: <p>I have created cardView but how can I convert it to <code>&lt;FlatList/&gt;</code> I am not able to understand what should be the <code>renderItem</code> of <code>FlatList</code> ?</p>
  
  <p>My current code:</p>
  
  <pre><code>&lt;ScrollView style={styles.container}&gt;
                  &lt;View style={styles.cardView}&gt;
                      &lt;Text style={styles.projectName}&gt;{marketing_updates.length != 0 ? marketing_updates[0].project_name: ""}&lt;/Text&gt;
                      &lt;Text style={styles.title}&gt;{marketing_updates.length != 0 ? marketing_updates[0].title: ""}&lt;/Text&gt;
                      &lt;Text style={styles.description}&gt;Description: {marketing_updates.length != 0 ? marketing_updates[0].description: ""}&lt;/Text&gt;
                      &lt;Image
                      style={styles.img}
                      source={{uri: marketing_updates.length != 0 ? marketing_updates[0].image: null}}
                      /&gt;
                      &lt;View style={styles.buttons}&gt;
                          &lt;Text style={styles.like}&gt;Like&lt;/Text&gt;
                          &lt;Text style={styles.share}&gt;Share&lt;/Text&gt;
                      &lt;/View&gt;
                      &lt;View style={styles.comment}&gt;
                          &lt;Text&gt;Comments: &lt;/Text&gt;
                          &lt;Text&gt;comment 1&lt;/Text&gt;
                          &lt;Text&gt;comment 2&lt;/Text&gt;
                          &lt;Text&gt;comment 3&lt;/Text&gt;
                      &lt;/View&gt;
                  &lt;/View&gt;
  
              &lt;/ScrollView&gt;
  </code></pre>
  
  <p>How can I convert it to FlatList ?</p>
  
  <p>What I tried :</p>
  
  <pre><code>&lt;ScrollView style={styles.container}&gt;
                  &lt;FlatList
                  data={marketing_updates.length != 0 &amp;&amp; marketing_updates ? marketing_updates : null}
                  renderItem={}
                  /&gt;
  
              &lt;/ScrollView&gt;
  </code></pre>
  
  <p>I am not able to understand what should be there inside <code>renderItem={}</code> ?</p>