UNPKG

@sampettersson/constate

Version:

Yet another React state management library that lets you work with local state and scale up to global state with ease

12 lines (11 loc) 435 B
import * as React from "react"; import { StateUpdater, StateCallback, MountContainer } from "./types"; export interface ContextState { state: { [key: string]: any; }; setContextState?: <S, K>(context: string, updaterOrState: StateUpdater<S> | Partial<S>, callback?: StateCallback, type?: K) => void; mountContainer?: MountContainer; } declare const Context: React.Context<ContextState>; export default Context;