title: CheckBoxes React Native Map function returns error: Too many re-renders. React limits the number of renders to prevent an infinite loop
body: <p>I have this code, that should draw checkbox'es.</p>
  
  <p>here is my Hashtags.js file:</p>
  
  <pre><code>import React, { useState } from 'react';
  import {StyleSheet, View, Image} from 'react-native';
  import { CheckBox } from 'react-native-elements';
  const HashtagsList =[
    {checked: false, title: '#tip1'},
    {checked: false, title: '#tip2'},
    {checked: false, title: '#tip3'},
    {checked: false, title: '#tip4'},
    {checked: false, title: '#tip5'},
    {checked: false, title: '#tip6'}, 
  ];
  
  const Hashtags = props =&gt; { 
    const [hashtags, setHastags] = useState([]);
    setHastags(HashtagsList);
  
  const toggleCheckbox = (title) =&gt;{   
    const checkedHashtags = hashtags.find((hashtag) =&gt; hashtag.title === title);
    checkedHashtags.checked = !checkedHashtags.checked;
    const checkboxes = Object.assign({}, hashtags, checkedHashtags);
    setHastags({ checkboxes });
  };
  
  hashtags.map((hashtag, i) =&gt; {
    console.log(hashtag);
    return (
      &lt;CheckBox
        key = {i}
        title = {hashtag.title}
        checkedIcon={&lt;Image style={styles.chekBoxPic} source={require('../assets/svg/checked.svg')} /&gt;}
        uncheckedIcon={&lt;Image style={styles.chekBoxPic} source={require('../assets/svg/unchecked.svg')} /&gt;}        
        checked={hashtag.checked}
        onPress={() =&gt; toggleCheckbox(hashtag.title)}
      /&gt; 
      );
   })
  
  };
  const styles = StyleSheet.create({   
    chekBoxPic:{
      width: 22, 
      height: 22, 
    },
  });
  export default Hashtags;
  </code></pre>
  
  <p>My main.js page looks like this:</p>
  
  <pre><code>...
  &lt;View type={styles.someStyle}&gt;
     &lt;Hashtags /&gt;
    &lt;/View&gt;
  ...
  </code></pre>
  
  <p>But i get error:'Too many re-renders. React limits the number of renders to prevent an infinite loop.'
  Where I make a mistake?</p>