title: How to update component information in react native?
body: <p>I'm consuming the data from this api, using useEffect.
  What I want, is that every time the data changes in the API. Change component information</p>
  <pre><code>const [infoUser, setInfoUser] = useState([]);
  const getInfoUser = async () =&gt; {
      try {
        const accessToken = await AsyncStorage.getItem('@access_token');
  
        axios
          .get(
            'https://apiexample.com/cliete',
            {
              headers: { Authorization: `Bearer ${accessToken}` },
            },
          )
          .then(function (response) {
            // handle success
            console.log('DADOS USER:', response.data.data);
            const userData = response.data.data;
  
            setInfoUser([...infoUser, userData]);
          })
          .catch(function (error) {
            // handle error
            console.log(error);
          });
      } catch (e) {
        // error reading value
        console.log('Erro de token', e);
      }
    };
  
    useEffect(() =&gt; {
      getInfoUser();
    }, []);
  </code></pre>
  <p>On another screen, I change the data and save.</p>
  <p>But the previous screen has not been updated.
  The data only changes when I log out and enter the app again</p>
  <pre><code>{infoUser.map(user =&gt; (
              &lt;Text style={styles.subtitle}&gt;Nome Completo&lt;/Text&gt;
              &lt;Text style={styles.title}&gt;{user.nomeCompleto}&lt;/Text&gt;
            &lt;/TouchableOpacity&gt;
          ))}
  </code></pre>