title: React Native Firebase refresh user record
body: <p>I'm currently building a firebase login system with a verified email screen.</p>
  <p>My problem is that I have a reload user button on the verified email screen that updates the user's credentials so that my root directory redirects the user to the AppStack if currentUser.emailVerified === true.
  but the reload button isn't being triggered once pressed so that my root directory is still currentUser.emailVerified === false and not redirecting the user to the AppStack.</p>
  <p>Login-System/context/AuthContext.js:</p>
  <pre><code>import React, { createContext, useContext, useState, useEffect } from 'react';
  import { auth } from '../config';
  
  const AuthContext = createContext();
  
  export function useAuth() {
    return useContext(AuthContext);
  }
  
  export function AuthProvider({ children }) {
    const [currentUser, setCurrentUser] = useState();
    const [loading, setLoading] = useState(true);
   
    function sendVerification() {
      return currentUser.sendEmailVerification();
    }
  
    const getUser = () =&gt; auth.currentUser;
  
    const reloadUser = () =&gt; getUser().reload();
  
    const reload = async () =&gt; {
      try {
        await reloadUser();
        const user = getUser();
        setCurrentUser(user);
      } catch (error) {}
      return reload;
    };
  
    useEffect(() =&gt; {
      const unsubscribe = auth.onAuthStateChanged(user =&gt; {
        setCurrentUser(user);
        setLoading(false);
      });
  
      return () =&gt; {
        unsubscribe();
      };
    }, []);
  
    const value = {
      currentUser,
      loading,
      reload,
      sendVerification,
    };
  
    return (
      &lt;AuthContext.Provider value={value}&gt;
        {!loading &amp;&amp; children}
      &lt;/AuthContext.Provider&gt;
    );
  }
  </code></pre>
  <p>Login-System/screens/VerifyEmailScreen.js:</p>
  <pre><code>import React from 'react';
  import { Text, StyleSheet } from 'react-native';
  
  import { useAuth } from '../contexts/AuthContext';
  import { View, Button } from '../components';
  import { Colors } from '../config';
  
  export const VerifyEmailScreen = () =&gt; {
    const { currentUser, reload, sendVerification } = useAuth();
  
    const handleSendVerification = async () =&gt; {
      try {
        await sendVerification();
      } catch (error) {}
      return handleSendVerification;
    };
  
    return (
      &lt;&gt;
        &lt;View isSafe style={styles.container}&gt;
          &lt;View style={styles.center}&gt;
            &lt;Text style={styles.screenTitle}&gt;Check your email&lt;/Text&gt;
            &lt;Text style={styles.screenInfo}&gt;{currentUser.email}&lt;/Text&gt;
            &lt;Text style={styles.screenInfo}&gt;
              We sent you an email with instructions on how to verify your email
              address. Click on the link in the email to get started.
            &lt;/Text&gt;
  
            &lt;Button
              style={styles.button}
              onPress={() =&gt; handleSendVerification()}&gt;
              &lt;Text style={styles.buttonText}&gt;Resend&lt;/Text&gt;
            &lt;/Button&gt;
            &lt;Button style={styles.button} onPress={reload}&gt;
              &lt;Text style={styles.buttonText}&gt;Done&lt;/Text&gt;
            &lt;/Button&gt;
          &lt;/View&gt;
        &lt;/View&gt;
      &lt;/&gt;
    );
  };
  </code></pre>