Created
November 22, 2020 22:47
-
-
Save jamiehaywood/fe22c4a41987259113c05f7ecacae54f 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 useGlobalState = () => { | |
const context = useContext(GlobalStateContext); | |
if (!context) { | |
throw new Error("useGlobalState must be used within a GlobalStateContext"); | |
} | |
return context; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment