title: why I am getting this error what is the problem in my code?
body: <p>This is my code and the error I am getting is in attached picture what is the error in my code. The Purpose of my code is that whenever I click <em>Add new box</em> button a box with random color will be displayed below the previously created box.</p>
  <pre><code>import {styleSheets,View,Text,Button,FlatList} from 'react-native';
  
  const ColorF= () =&gt; {
      const[colors,setColor] = useState([]);
      //console.log(colors)
  &lt;View&gt;
      &lt;Button title = &quot;Add a new box&quot;
      onPress = {()=&gt;{
          setColor([...colors,randomRgb()])
      }}
      /&gt;
      &lt;/View&gt; 
      return(
      
  &lt;FlatList
      data = {colors}
      KeyExtractor = {(colors)=&gt;colors.item}
      renderItem = {({item})=&gt;{
      
      return &lt;View style ={{height:100,width:100,backgroundColor:randomRgb(item)}}&gt;
      }
      }
      /&gt;
      );
  }
  
  const randomRgb=()=&gt;{
      const red = Math.floor(Math.random()*256);
      const green = Math.floor(Math.random()*256);
      const blue = Math.floor(Math.random()*256);
      return `rgb(${red},${green},${blue})`;
  
  };
  
  export default ColorF;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/v8KLh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v8KLh.png" alt="This is the error I am getting" /></a>
  <a href="https://i.stack.imgur.com/fByzF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fByzF.png" alt="This is the error I am getting" /></a></p>