When I submit the info, the console.log gives me back a user.user.uid value. But when setting the value to a variable using useState, it sets the value as null and passes null value to userInfo function. userInfo is also an async function. Why is that?
const handleSubmit = async (e, email, password) => {
e.preventDefault();
try {
const user = await createUserWithEmailAndPassword(auth, email, password);
console.log(user.user.uid);
await setUserId(user.user.uid);
} catch (e) {
console.log(e);
}
await userInfo(email, password, userId);
};