-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-hooks.d.ts
27 lines (26 loc) · 986 Bytes
/
react-hooks.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import * as React from "react";
declare module "react" {
function useState<T>(initialState: T | (() => T)): [T, (newState: T) => void];
function useEffect(
create: () => void | (() => void),
inputs?: ReadonlyArray<unknown>
): void;
function useContext<T>(foo: React.Context<T>): T;
function useReducer<S, A>(
reducer: (state: S, action: A) => S,
initialState: S
): [S, (action: A) => void];
function useCallback<F extends (...args: never[]) => unknown>(
callback: F,
inputs?: ReadonlyArray<unknown>
): F;
function useMemo<T>(create: () => T, inputs?: ReadonlyArray<unknown>): T;
function useRef<T extends unknown>(initialValue?: T): React.RefObject<T>;
function useImperativeMethods<T>(
ref: React.Ref<T>,
createInstance: () => T,
inputs?: ReadonlyArray<unknown>
): void;
const useMutationEffect: typeof useEffect;
const useLayoutEffect: typeof useEffect;
}