Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions types/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -834,17 +834,6 @@ declare namespace React {
*/
// TODO (TypeScript 3.0): <T extends unknown>
function useRef<T>(initialValue: T|null): RefObject<T>;
/**
* 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
Expand Down
4 changes: 1 addition & 3 deletions types/react/test/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down