Size
0.14 kb
useInvariantContext
useContext that throws if the provider is not found.
Installation
Usage
An error is thrown if the context value is falsy.
Example
This example shows how to use useInvariantContext to avoid missing context provider.
useContext that throws if the provider is not found.
An error is thrown if the context value is falsy.
This example shows how to use useInvariantContext to avoid missing context provider.