react-use/src/react.ts
2018-10-27 02:27:42 +02:00

11 lines
433 B
TypeScript

import * as React from 'react';
export type UseState = <T>(initialState: T) => [T, (newState: T) => void];
export const useState: UseState = (React as any).useState;
export type UseEffect = (didUpdate: () => ((() => void) | void), params?: any[]) => void;
export const useEffect: UseEffect = (React as any).useEffect;
export type UseRef = <T>(initialValue: T) => {current: T};
export const useRef: UseRef = (React as any).useRef;