diff --git a/types/react/index.d.ts b/types/react/index.d.ts index f525d7838c..71885b7253 100644 --- a/types/react/index.d.ts +++ b/types/react/index.d.ts @@ -834,17 +834,6 @@ declare namespace React { */ // TODO (TypeScript 3.0): function useRef(initialValue: T|null): RefObject; - /** - * The signature is identical to `useEffect`, but it fires synchronously during the same phase that - * React performs its DOM mutations, before sibling components have been updated. Use this to perform - * custom DOM mutations. - * - * Prefer the standard `useEffect` when possible to avoid blocking visual updates. - * - * @version experimental - * @see https://reactjs.org/docs/hooks-reference.html#usemutationeffect - */ - function useMutationEffect(effect: EffectCallback, inputs?: InputIdentityList): void; /** * The signature is identical to `useEffect`, but it fires synchronously after all DOM mutations. * Use this to read layout from the DOM and synchronously re-render. Updates scheduled inside diff --git a/types/react/test/hooks.tsx b/types/react/test/hooks.tsx index c3495dd717..5239d3b522 100644 --- a/types/react/test/hooks.tsx +++ b/types/react/test/hooks.tsx @@ -95,11 +95,9 @@ function useEveryHook(ref: React.Ref<{ id: number }>|undefined): () => boolean { // $ExpectError React.useImperativeMethods(ref, () => ({}), [id]); - React.useMutationEffect(() => { + React.useLayoutEffect(() => { setState(1); setState(prevState => prevState - 1); - }, []); - React.useLayoutEffect(() => { didLayout.current = true; }, []); React.useEffect(() => {