title: React-Navigation useIsFocused always returns true, and I can't figure out why?
body: <p>I have pretty simple use case for this, Basically if the screen is focused I want this function to run, if not don't run.</p>
  <pre><code>
    const isFocused = useIsFocused();
  
    const onViewRef = useRef(({ viewableItems }) =&gt; {
  
      if (!isFocused) return;
  
      //code to run
    });
  
  </code></pre>
  <p>Here's the stack for this screen in particular:</p>
  <pre><code>const MyStack = () =&gt; {
    return (
      &lt;Stack.Navigator headerMode=&quot;none&quot;&gt;
        &lt;Stack.Screen
          component={MyStackComponent}
          name=&quot;My&quot;
        /&gt;
      &lt;/Stack.Navigator&gt;
    );
  };
  
  </code></pre>
  <p>And here is that stack being use in a tabNavigator</p>
  <pre><code>     &lt;Tab.Screen
          component={MyStack}
          name=&quot;My&quot;
        /&gt;
        &lt;Tab.Screen
            component={Other Stack}
            name=&quot;Other&quot;
          /&gt;
        
  </code></pre>
  <p>So basically whenever I go to any other tab on my app, the file using the useIsFocused hook should should return false right? Because right now it returns true no matter what, and I can't have that function running all the time. Any pointers?</p>