Created
April 17, 2021 20:13
-
-
Save KattyaCuevas/b0888b31e3bb686284fd4f8df4392115 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
const [currentUser, setCurrentUser] = React.useState(null); | |
const [counter, setCounter] = React.useState(1); | |
return ( | |
<SessionContext.Provider | |
value={React.useMemo(() => ({ currentUser, setCurrentUser }), [ | |
currentUser, | |
setCurrentUser, | |
])} | |
> | |
<CounterContext.Provider | |
value={React.useMemo(() => ({ counter, setCounter }), [ | |
counter, | |
setCounter, | |
])} | |
> | |
<SessionForm /> | |
<SessionCounterMessage /> | |
<CounterButtons /> | |
</CounterContext.Provider> | |
</SessionContext.Provider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment