0
I’m trying to use the Reactjs Context but I can’t get the Provider to assign the value to the context variable. whenever I check the empty variable.
Context:
import React from 'react'
const AppContext = React.createContext({
userData:{}
})
export default AppContext
Place where I pass the variable (there is value in it)
console.log("USUARIO", user)
return (
<AppContext.Provider value={{ userData: user }}>
Where I use Consumer:
<AppContext.Consumer>
{context => (
Hello Jason, in the log console before Return, is the user filled out? Where did you say you are checking the variable?
– Daniel Obara
Yeah, I checked that out.
– Jason Beestart