We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80a0c05 commit fefa126Copy full SHA for fefa126
1 file changed
packages/react-reconciler/src/ReactFiberCommitWork.js
@@ -499,13 +499,7 @@ function commitUnmount(current: Fiber): void {
499
case ClassComponent: {
500
safelyDetachRef(current);
501
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
- ) {
+ if (typeof instance.componentWillUnmount === 'function') {
509
safelyCallComponentWillUnmount(current, instance);
510
}
511
return;
0 commit comments