DEV Community

Discussion on: React TypeScript - How To Set Types on Hooks (+cheat sheet)

Collapse
 
beraliv profile image
beraliv

Is there a way to apply types to useContext that prohibits using hook in case, the respective Provider won't be used with this component? It prevents forgetting the usage of providers.