title: Is there a way to refresh the contents of HomeStacks screen in react expo on every click?
body: <p>I'm developing a mobile app with react expo. I have a menu that fetches a list of items.  Unfortunately, it only fetches data on the first click. When I navigate from one menu to another it does not refresh the data.</p>
  <pre><code>  useEffect(() =&gt; {
      getItemsListGET();
    },[]);
  
    const getItemsListGET = async () =&gt; {
      try {
        await refreshTokens(tokens.refreshToken).then((response) =&gt; {
          dispatch(
            pushAlltoken({
              token: response.data.token,
              refreshToken: response.data.refreshToken,
            })
          );
  
          try {
            setloading(true);
            axios
              .get(`${myURL}`, {
                headers: {
                  Authorization: `Bearer ${response.data.token}`,
                },
              })
              .then((result) =&gt; {
                setMyliste([...new Set([...myliste ,...result.data.list])])
                setloading(false);
  
  
              }).then(
                
              );
          } catch (error) {
            console.log(&quot;there was a problem in getitems function&quot;, error);
            setloading(false);
          }
        });
      } catch (error) {
        console.log(&quot;Error from all function &quot;, error);
        setloading(false);
      }
    };
  </code></pre>
  <p>And the code of the navigation is the following</p>
  <pre><code>    export default function HomeStack() {
    return (
      &lt;HomeStacks.Navigator headerMode={&quot;none&quot;}&gt;
        &lt;HomeStacks.Screen
          name=&quot;HomeScreen&quot;
          component={Home}
          options={{ headerTitle: &quot;Home&quot; }}
        /&gt;
  
        &lt;HomeStacks.Screen
          name=&quot;Product&quot;
          component={Product}
          options={{ headerTitle: &quot;Product&quot; }}
        /&gt;
  
      &lt;/HomeStacks.Navigator&gt;
    );
  }
  </code></pre>