Skip to content

Commit fefa126

Browse files
acdlitebvaughn
authored andcommitted
Revert accidentally committed existence check (#13931)
1 parent 80a0c05 commit fefa126

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,7 @@ function commitUnmount(current: Fiber): void {
499499
case ClassComponent: {
500500
safelyDetachRef(current);
501501
const instance = current.stateNode;
502-
if (
503-
// Typically, a component that mounted will have an instance. However,
504-
// outside of concurrent mode, a suspended component may commit without
505-
// an instance, so we need to check whether it exists.
506-
instance !== null &&
507-
typeof instance.componentWillUnmount === 'function'
508-
) {
502+
if (typeof instance.componentWillUnmount === 'function') {
509503
safelyCallComponentWillUnmount(current, instance);
510504
}
511505
return;

0 commit comments

Comments
 (0)