From 7988acaa95bb6cd889820ea07c960a824b43e9eb Mon Sep 17 00:00:00 2001 From: Timothy Yung Date: Tue, 7 Jun 2016 17:23:40 -0700 Subject: [PATCH] Improve error message for components in bad states (missing instance) (#6990) --- .../shared/stack/reconciler/ReactCompositeComponent.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js index 7a02c1904a7f6..75f5dc7922d20 100644 --- a/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js +++ b/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js @@ -741,6 +741,13 @@ var ReactCompositeComponentMixin = { nextUnmaskedContext ) { var inst = this._instance; + invariant( + inst != null, + 'Attempted to update component `%s` that has already been unmounted ' + + '(or failed to mount).', + this.getName() || 'ReactCompositeComponent' + ); + var willReceive = false; var nextContext; var nextProps;