Skip to content

createContext ​

helpers
test coverage
Last changed: 16 seconds ago

Creates a typed context with additional utilities

typescript
import { createContext } from '@siberiacancode/reactuse';

Usage ​

typescript
const { useSelect, instance, Provider } = createContext<number>(0);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
defaultValue?Value | undefined-- Default value for the context
options?CreateContextOptions<Value>-- Additional options for context creation

Source ​

Source • Demo

Contributors ​

Released under the MIT License.