From fefa1269e2a67fa5ef0992d5cc1d6114b7948b7e Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Tue, 23 Oct 2018 14:27:04 -0700 Subject: [PATCH] Revert accidentally committed existence check (#13931) --- packages/react-reconciler/src/ReactFiberCommitWork.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.js b/packages/react-reconciler/src/ReactFiberCommitWork.js index 1efd1fcf8d..60662d2388 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.js @@ -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;