i am building a react app in which i am using firebase for authentication. the code is as follows:
function signIn(){
firebase.auth().signInWithPopup(provider).then(function(result)=>{
console.log(result.user);
setUserInfo(result.user);
console.log(userInfo);
}).catch(function(error)=>{
console.log(error.message);
});
}
const [userInfo, setUserInfo] = useState({});
now when console logging result.user, the data is perfect. but when i assign it to userInfo and console log it, it returns an empty object with something like this-
{proto}