title: Firebase Phone Auth with React Native Expo
body: <p>So I have been trying to implement the firebase phone auth in my react native project. I followed this great tutorial linked below but was facing issues with changing the confirmation section to be in a different page instead of the phone number input and code input all being on the same page. I get an error stating the verificationId was not found as its being called in the previous page.</p>
  <p><a href="https://arjayosma.medium.com/set-up-firebase-phone-authentication-in-expo-sdk-37-without-ejecting-8a472460b1cf" rel="nofollow noreferrer">Tutorial Link</a></p>
  <p>If anyone can help out out, that would be great.</p>
  <p>Thanks</p>
  <pre><code>  const const Login  = () =&gt; {
    const navigation =useNavigation();
    const [phoneNumber, setPhoneNumber] = useState();
  
    const [verificationId, setVerificationId] = useState(null);
    const recaptchaVerifier = useRef(null);
  
  
  
  
      const sendVerification  = () =&gt; {
         try {
      const phoneProvider = new firebase.auth.PhoneAuthProvider();
      phoneProvider
     .verifyPhoneNumber(phoneNumber, recaptchaVerifier.current)
     .then(setVerificationId);
       } catch (error) {
     alert(error);
       }
       navigation.navigate('OTPScreen', { verificationId: 
     verificationId})
  
  
       };
      return(
     
  </code></pre>
  <p>OTP screen</p>
  <pre><code>const const OTPScreen  = () =&gt; {
  
  const verificationId = props.route.params.verificationId
   const [code, setCode] = useState('');
  
  
  const confirmCode = () =&gt; {
    const credential = 
    firebase.auth.PhoneAuthProvider.credential(
      verificationId,
      code
    );
    firebase
      .auth()
      .signInWithCredential(credential)
      .then((result) =&gt; {
        console.log(result); 
        navigation.navigate('Home')  
          
      });
      
  
      };
     return(
     
  </code></pre>