Clear error message when rendering a nonvalid component

This commit is contained in:
Matti Nelimarkka 2013-11-01 17:32:09 -07:00
parent aedf580a33
commit 9e24257a4e
1 changed files with 2 additions and 1 deletions

View File

@ -860,7 +860,8 @@ var ReactCompositeComponentMixin = {
}
invariant(
ReactComponent.isValidComponent(renderedComponent),
'%s.render(): A valid ReactComponent must be returned.',
'%s.render(): A valid ReactComponent must be returned. You may have ' +
'returned null, undefined, an array or some other invalid object.',
this.constructor.displayName || 'ReactCompositeComponent'
);
return renderedComponent;