mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Remove useMutationEffect (#31013)
https://github.com/facebook/react/pull/14336
This commit is contained in:
committed by
John Reilly
parent
ead110d5f4
commit
3c3c8d08c4
Vendored
-11
@@ -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
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user