In my React Native app, I am trying to use the Firebase JS SDK with Expo as mentioned in
edit: I am using getAuth()
and the other methods in the following context:
React.useEffect(() => {
if (response?.type === "success") {
const { id_token } = response.params;
const auth = getAuth();
const provider = new GoogleAuthProvider();
const credential = provider.credential(id_token);
signInWithCredential(auth, credential);
}
}, [response]);
I am using Firebase 8.2.3.
CodePudding user response:
The import syntax you're using is for Firebase SDK version 9 and later. For version 8 and below, use:
import firebase from 'firebase/app';
import 'firebase/auth';
...
And then use the v8 syntax as shown here.