title: React Native: Saving array via AsyncStorage and retrieving it
body: <p>I am trying to get an array of objects from my <code>Redux-Store</code> state called <code>user</code> and save it to async storage and use <code>useState</code> with the <code>response</code> to <code>set the state</code> before I retrieve it and view it with the <code>FlatList</code> however I am getting an error along the lines of <code>Warning: Can't perform a React state update on an unmounted component.</code> The <code>user</code> details is being set to the redux store in another component and then being retrieved from the current component I am displaying. Please could I get your help . I would really appreciate it. Thank you in advance!!!</p>
  <pre><code>const TheUser = (props) =&gt; {
      //user is an array from redux store
      const user = useSelector(state =&gt; state.account.cookbook)
      const [getUser, setGetUser] = useState()
  
      const saveUserAsync = async () =&gt; {
          await AsyncStorage.setItem('user', JSON.stringify(user))
      }
      saveUserAsync()
  
      AsyncStorage.getItem('user').then(response =&gt; {
          setGetUser(response)
      })
      return (
          &lt;FlatList
              data={getUser}
              keyExtractor={item =&gt; item.id}
              renderItem={itemData =&gt;
                  &lt;MyUser
                      name={itemData.item.name}
                      image={itemData.item.imageUri}
                      details={itemData.item.details.val}
                  /&gt;
              }
          /&gt;
      )
  }
  export default TheUser
  </code></pre>