Skip to content

Instantly share code, notes, and snippets.

@yarigpopov
Created October 13, 2021 10:20
Show Gist options
  • Save yarigpopov/26f18319596bf6225d21c317e415b47c to your computer and use it in GitHub Desktop.
Save yarigpopov/26f18319596bf6225d21c317e415b47c to your computer and use it in GitHub Desktop.
export function useDogProviderState() {
const context = React.useContext(DogDataProviderContext);
if (context === undefined) {
throw new Error('useDogProviderState must be used within DogDataProvider.');
}
return context;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment