Revert accidentally committed existence check (#13931)

This commit is contained in:
Andrew Clark
2018-10-23 14:27:04 -07:00
committed by Brian Vaughn
parent 80a0c05ce3
commit fefa1269e2
+1 -7
View File
@@ -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;