UNPKG

ahooks

Version:
4 lines (3 loc) 300 B
export 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; declare const useSetState: <S extends Record<string, any>>(initialState: S | (() => S)) => [S, SetState<S>]; export default useSetState;