Skip to content

Commit be50757

Browse files
committed
Delete commitDetachRef
1 parent 3716c39 commit be50757

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

packages/react-reconciler/src/ReactFiberCommitWork.new.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,27 +1629,6 @@ function commitAttachRef(finishedWork: Fiber) {
16291629
}
16301630
}
16311631

1632-
function commitDetachRef(current: Fiber) {
1633-
const currentRef = current.ref;
1634-
if (currentRef !== null) {
1635-
if (typeof currentRef === 'function') {
1636-
if (shouldProfile(current)) {
1637-
try {
1638-
startLayoutEffectTimer();
1639-
currentRef(null);
1640-
} finally {
1641-
recordLayoutEffectDuration(current);
1642-
}
1643-
} else {
1644-
currentRef(null);
1645-
}
1646-
} else {
1647-
// $FlowFixMe unable to narrow type to the non-function case
1648-
currentRef.current = null;
1649-
}
1650-
}
1651-
}
1652-
16531632
function detachFiberMutation(fiber: Fiber) {
16541633
// Cut off the return pointer to disconnect it from the tree.
16551634
// This enables us to detect and warn against state updates on an unmounted component.
@@ -4470,7 +4449,6 @@ function invokePassiveEffectUnmountInDEV(fiber: Fiber): void {
44704449
export {
44714450
commitPlacement,
44724451
commitAttachRef,
4473-
commitDetachRef,
44744452
invokeLayoutEffectMountInDEV,
44754453
invokeLayoutEffectUnmountInDEV,
44764454
invokePassiveEffectMountInDEV,

packages/react-reconciler/src/ReactFiberCommitWork.old.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,27 +1629,6 @@ function commitAttachRef(finishedWork: Fiber) {
16291629
}
16301630
}
16311631

1632-
function commitDetachRef(current: Fiber) {
1633-
const currentRef = current.ref;
1634-
if (currentRef !== null) {
1635-
if (typeof currentRef === 'function') {
1636-
if (shouldProfile(current)) {
1637-
try {
1638-
startLayoutEffectTimer();
1639-
currentRef(null);
1640-
} finally {
1641-
recordLayoutEffectDuration(current);
1642-
}
1643-
} else {
1644-
currentRef(null);
1645-
}
1646-
} else {
1647-
// $FlowFixMe unable to narrow type to the non-function case
1648-
currentRef.current = null;
1649-
}
1650-
}
1651-
}
1652-
16531632
function detachFiberMutation(fiber: Fiber) {
16541633
// Cut off the return pointer to disconnect it from the tree.
16551634
// This enables us to detect and warn against state updates on an unmounted component.
@@ -4470,7 +4449,6 @@ function invokePassiveEffectUnmountInDEV(fiber: Fiber): void {
44704449
export {
44714450
commitPlacement,
44724451
commitAttachRef,
4473-
commitDetachRef,
44744452
invokeLayoutEffectMountInDEV,
44754453
invokeLayoutEffectUnmountInDEV,
44764454
invokePassiveEffectMountInDEV,

0 commit comments

Comments
 (0)