@td-design/rn-hooks
Version:
从ahooks里面抽取的一些在rn项目里可以使用的hooks。提高开发效率
10 lines (9 loc) • 382 B
TypeScript
import type { Dispatch, SetStateAction } from 'react';
type GetStateAction<S> = () => S;
declare function useGetState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>, GetStateAction<S>];
declare function useGetState<S = undefined>(): [
S | undefined,
Dispatch<SetStateAction<S | undefined>>,
GetStateAction<S | undefined>
];
export default useGetState;