mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add more helpful invariant if you're updating an unrendered component
This commit is contained in:
@@ -726,6 +726,11 @@ var ReactCompositeComponentMixin = {
|
||||
ReactComponent.Mixin.updateComponent.call(this, transaction, prevProps);
|
||||
var currentComponent = this._renderedComponent;
|
||||
var nextComponent = this._renderValidatedComponent();
|
||||
invariant(
|
||||
typeof currentComponent !== 'undefined',
|
||||
'updateComponent(...): You are attempting to update an unrendered ' +
|
||||
'component.'
|
||||
);
|
||||
if (currentComponent.constructor === nextComponent.constructor) {
|
||||
currentComponent.receiveProps(nextComponent.props, transaction);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user