UNPKG

382 BTypeScriptView Raw
1import type { Dispatch, SetStateAction } from 'react';
2type GetStateAction<S> = () => S;
3declare function useGetState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, GetStateAction<S>];
4declare function useGetState<S = undefined>(): [
5 S | undefined,
6 Dispatch<SetStateAction<S | undefined>>,
7 GetStateAction<S | undefined>
8];
9export default useGetState;