Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions packages/react-reconciler/src/ReactFiberCommitWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,7 @@ function commitUnmount(current: Fiber): void {
case ClassComponent: {
safelyDetachRef(current);
const instance = current.stateNode;
if (
// Typically, a component that mounted will have an instance. However,
// outside of concurrent mode, a suspended component may commit without
// an instance, so we need to check whether it exists.
instance !== null &&
typeof instance.componentWillUnmount === 'function'
) {
if (typeof instance.componentWillUnmount === 'function') {
safelyCallComponentWillUnmount(current, instance);
}
return;
Expand Down