@rozhkov/react-useful-hooks
Version:
Useful hooks for React application
12 lines • 406 B
TypeScript
import { Dispatch, SetStateAction } from 'react';
type Ref<T> = {
readonly current: T;
};
declare function useStateRef<S = undefined>(): [
S | undefined,
Dispatch<SetStateAction<S | undefined>>,
Ref<S | undefined>
];
declare function useStateRef<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, Ref<S>];
export default useStateRef;
//# sourceMappingURL=useStateRef.d.ts.map