Created
April 17, 2021 20:12
-
-
Save KattyaCuevas/865701a0996071c431b8c121f9acf971 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
const MyContext = React.useContext({}); | |
function App() { | |
const [state, setState] = React.useState(false); | |
return ( | |
<MyContext.Provider value={{ state, setState }}> | |
<MyCustomComponent /> | |
</MyContext.Provider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment