try{
const user = await createUserWithEmailAndPassword(auth, email, password)
console.log(user);
navigate('/login');
toast.success('Registered Successfully');
}
catch(error){
console.log(error);
}
I’m trying to display toast message after navigates to login page. But I didn’t getting any toast notification after redirecting to login page. Plase help me to slove this
2
Answers
I guess you need to add some sort of delay before
navigating
to otherscreen
otherwise the process would be so fast that user won’t be able to see thetoast
. Try doing like this:your code doesn’t reach
toast.success
because your app navigates to /login.you need to fire
toast
from login page after passing a query param.in login page: