As you’re passing an object as your context value, whenever you want to use the rmail field you may do something like:
const ctx = useContext(UserContext);
ctx.emailLogin(...)
so as to access the emailLogin
field. Or more simpler : const { emailLogin } = useContext(UserContext);
Don’t forget to import the UserContext
first.
CLICK HERE to find out more related problems solutions.