UNPKG

287 BTypeScriptView Raw
1import type { Dispatch, SetStateAction } from 'react';
2declare function useSafeState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];
3declare function useSafeState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];
4export default useSafeState;