Last active
July 31, 2020 02:44
-
-
Save woodRock/2a76dd2e55d8b95f089ee5d246502a2e to your computer and use it in GitHub Desktop.
React Context Template. In React, a Context is similar to a Global Variable from OO programming. We can make variables, functions, API calls, etc... accessible across multiple components.
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
import { useContext } from "./context"; | |
const Example = () => { | |
const [thing] = useContext(); | |
return ( | |
<> | |
{thing} | |
</> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment