Consume React.createContext() implemented in _app.js

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);

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.

Leave a Comment

Your email address will not be published.

Scroll to Top