Created
November 11, 2018 20:16
-
-
Save mizchi/bfc0986c5fd3c695a38d0d573909efc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
declare module "react" { | |
// Suspense | |
function lazy(loader: () => Promise<any>): React.ComponentType<any>; | |
const Suspense: React.ComponentType<any>; | |
// Hooks | |
function useState<T>( | |
initialState: T | (() => T) | |
): [T, (newState: T | ((s: T) => 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment