Skip to content

Commit e90e878

Browse files
yungsterszpao
authored andcommitted
Improve error message for components in bad states (missing instance) (facebook#6990)
(cherry picked from commit 7988aca)
1 parent 9358c19 commit e90e878

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/renderers/shared/stack/reconciler/ReactCompositeComponent.js

+7
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,13 @@ var ReactCompositeComponentMixin = {
741741
nextUnmaskedContext
742742
) {
743743
var inst = this._instance;
744+
invariant(
745+
inst != null,
746+
'Attempted to update component `%s` that has already been unmounted ' +
747+
'(or failed to mount).',
748+
this.getName() || 'ReactCompositeComponent'
749+
);
750+
744751
var willReceive = false;
745752
var nextContext;
746753
var nextProps;

0 commit comments

Comments
 (0)