mirror of
https://github.com/streamich/react-use.git
synced 2026-01-18 14:06:52 +00:00
14 lines
711 B
TypeScript
14 lines
711 B
TypeScript
export declare type UseState = <T>(initialState: T | (() => T)) => [T, (newState: T | ((newState: any) => T)) => void];
|
|
export declare const useState: UseState;
|
|
export declare type UseEffect = (didUpdate: () => ((() => void) | void), params?: any[]) => void;
|
|
export declare const useEffect: UseEffect;
|
|
export interface ReactRef<T> {
|
|
current: T;
|
|
}
|
|
export declare type UseRef = <T>(initialValue: T) => ReactRef<T>;
|
|
export declare const useRef: UseRef;
|
|
export declare type UseCallback = <T extends ((...args: any[]) => any)>(callback: T, args: any[]) => T;
|
|
export declare const useCallback: UseCallback;
|
|
export declare type UseMemo = <T>(fn: Function, args: any[]) => T;
|
|
export declare const useMemo: UseMemo;
|