title: React Native: Unexpected text node: . A text node cannot be a child of a <View>
body: <p>I am working on making a React Native app and I am getting the error:</p>
  <blockquote>
  <p>Unexpected text node:  . A text node cannot be a child of a &lt;View&gt;.</p>
  </blockquote>
  <p>I cannot figure out what text node this error refers to. My goal is to render an array of views.</p>
  <p>Here is a minimal code snippet reproducing the error:</p>
  <pre><code>import React from 'react';
  import { StyleSheet, Text, View } from 'react-native';
  
  
  function fun() {
    const views = [];
  
    const style = {backgroundColor: 'red', height: 100, width: 100};
  
    for (let i=0; i&lt;3; i++) {
      views.push(
        &lt;View key={i} style={style}/&gt;
      )
    }
  
    return views;
  }
  
  export default function App() {
    return (
      &lt;View style={styles.container}&gt;
        &lt;Text&gt;Open up App.js to start working on your app!&lt;/Text&gt;
        
        &lt;View&gt; {fun()} &lt;/View&gt;
        
      &lt;/View&gt;
    );
  }
  
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      backgroundColor: '#fff',
      alignItems: 'center',
      justifyContent: 'center',
    },
  });
  
  </code></pre>