mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Revert accidentally committed existence check (#13931)
This commit is contained in:
committed by
Brian Vaughn
parent
80a0c05ce3
commit
fefa1269e2
+1
-7
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user