title: onSnapshot is not working properly in useEffect hook
body: <p>im working on a project on react native and im facing a bug , im trying to fetch the job of the current authenticated user which i stored in the firestore firebase ! i did that in the navigation component inside a useEffect hook so i can get the job of the current authenticated user because every job has it's own stack in the navigation ! but it's not giving me the right job i don't know why ! maybe i'm doing something wrong ?  in the onSnapShot im searching for the authenticated user id in the client users if it's there then hes a client , either way hes a delivery ! but still it's not working properly ! its giving me the wrong job  , i can share my screen if anyone is down  to help , thank you</p>
  <pre><code>
  const [job, setJob] = React.useState(&quot;delivery&quot;);
   const userJobFromSignup = useSelector((state) =&gt; state.auth.job);
  
   useEffect(() =&gt; {
     onAuthStateChanged(authentication, (user) =&gt; {
       if (user) {
         setUser(user);
         const unsub = onSnapshot(
           doc(db, &quot;users&quot;, &quot;jobs&quot;, &quot;client&quot;, authentication.currentUser.uid),
           (doc) =&gt; {
             if (doc.exists()) {
               setJob(&quot;client&quot;);
               console.log(job);
             } else {
               console.log(job);
             }
           }
         );
         return () =&gt; {
           unsub;
         };
       } else {
         setUser(null);
       }
     });
   }, []);
  </code></pre>