UNPKG

300 BTypeScriptView Raw
1export type SetState<S extends Record<string, any>> = <K extends keyof S>(state: Pick<S, K> | null | ((prevState: Readonly<S>) => Pick<S, K> | S | null)) => void;
2declare const useSetState: <S extends Record<string, any>>(initialState: S | (() => S)) => [S, SetState<S>];
3export default useSetState;