From 71a63230257ce17272f2ba4e404e8389e9d47b57 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 16 Nov 2022 15:15:34 +0000 Subject: [PATCH] Delete commitDetachRef --- .../src/ReactFiberCommitWork.new.js | 22 ------------------- .../src/ReactFiberCommitWork.old.js | 22 ------------------- 2 files changed, 44 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.new.js b/packages/react-reconciler/src/ReactFiberCommitWork.new.js index ea45e6e390351..e91326e5645a2 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.new.js @@ -1629,27 +1629,6 @@ function commitAttachRef(finishedWork: Fiber) { } } -function commitDetachRef(current: Fiber) { - const currentRef = current.ref; - if (currentRef !== null) { - if (typeof currentRef === 'function') { - if (shouldProfile(current)) { - try { - startLayoutEffectTimer(); - currentRef(null); - } finally { - recordLayoutEffectDuration(current); - } - } else { - currentRef(null); - } - } else { - // $FlowFixMe unable to narrow type to the non-function case - currentRef.current = null; - } - } -} - function detachFiberMutation(fiber: Fiber) { // Cut off the return pointer to disconnect it from the tree. // This enables us to detect and warn against state updates on an unmounted component. @@ -4470,7 +4449,6 @@ function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { export { commitPlacement, commitAttachRef, - commitDetachRef, invokeLayoutEffectMountInDEV, invokeLayoutEffectUnmountInDEV, invokePassiveEffectMountInDEV, diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.old.js b/packages/react-reconciler/src/ReactFiberCommitWork.old.js index 35c9a9740eb0f..5bad2a9026f9f 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.old.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.old.js @@ -1629,27 +1629,6 @@ function commitAttachRef(finishedWork: Fiber) { } } -function commitDetachRef(current: Fiber) { - const currentRef = current.ref; - if (currentRef !== null) { - if (typeof currentRef === 'function') { - if (shouldProfile(current)) { - try { - startLayoutEffectTimer(); - currentRef(null); - } finally { - recordLayoutEffectDuration(current); - } - } else { - currentRef(null); - } - } else { - // $FlowFixMe unable to narrow type to the non-function case - currentRef.current = null; - } - } -} - function detachFiberMutation(fiber: Fiber) { // Cut off the return pointer to disconnect it from the tree. // This enables us to detect and warn against state updates on an unmounted component. @@ -4470,7 +4449,6 @@ function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { export { commitPlacement, commitAttachRef, - commitDetachRef, invokeLayoutEffectMountInDEV, invokeLayoutEffectUnmountInDEV, invokePassiveEffectMountInDEV,