title: React Native: Conditional Render not working as it should
body: <p>I have a conditional statement that determines which JSX should be rendered on screen. It looks at an array held in the state, and, if empty, renders an image and some text. However, if populated, the data is rendered using Flat List.</p>
  
  <p>When the conditional statement equates to false (the array is empty) the image and text are rendered very briefly (for around half a second).</p>
  
  <p>How can I alter it so it does not appear at all? As the logic would suggest.</p>
  
  <p>My code is below:</p>
  
  <pre><code>render() {
  if (this.state.array === undefined || this.state.array.length === 0) {
    return (
      &lt;View&gt;
        &lt;View&gt;
          &lt;Text&gt; Tap the (+) button to add an item.&lt;/Text&gt;
          &lt;Image source={require('../images/image.png')} /&gt;
        &lt;/View&gt;
      &lt;/View&gt;
      );
  }
  
  //If array data
  return (
      &lt;View&gt;
        &lt;FlatList
            data={this.state.array}
            renderItem={({ item }) =&gt; &lt;TrackedItem {...item} /&gt;}
            keyExtractor={(item, index) =&gt; index.toString()}
        /&gt;
      &lt;/View&gt;
     );
   }
  </code></pre>