Skip to content

Commit 9e24257

Browse files
committed
Clear error message when rendering a nonvalid component
1 parent aedf580 commit 9e24257

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/ReactCompositeComponent.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,8 @@ var ReactCompositeComponentMixin = {
860860
}
861861
invariant(
862862
ReactComponent.isValidComponent(renderedComponent),
863-
'%s.render(): A valid ReactComponent must be returned.',
863+
'%s.render(): A valid ReactComponent must be returned. You may have ' +
864+
'returned null, undefined, an array or some other invalid object.',
864865
this.constructor.displayName || 'ReactCompositeComponent'
865866
);
866867
return renderedComponent;

0 commit comments

Comments
 (0)