I am using firebase google authentication to authenticate user using goole.
But i am facing an error which is given below....
(0, _auth.signInWithPopup) is not a function. (In '(0, _auth.signInWithPopup)(auth, provider)', '(0, _auth.signInWithPopup)' is
undefined)
and unable to fix it.
here is my code ...
import statements
import {getAuth,GoogleAuthProvider,signInWithPopup} from "firebase/auth"
the function
const googlelogin=async()=>{
const auth=getAuth()
const provider=new GoogleAuthProvider()
try{
const result=await signInWithPopup(auth,provider)
// const credentials=GoogleAuthProvider.credentialFromResult(result);
// const token=credentials.accessToken
// const user=result.user
}
catch(e){
console.log(e)
}
}
Please tell me how to solve this error...
Thanks in advance