Merge pull request #2946 from benmoss/nested-render-warning

Add displayName to nested render warnings [#1726]
This commit is contained in:
Ben Alpert committed 2015-03-10 15:24:59 -07:00
commit f77de57e41
2 files changed
+10 -6

No files matched your search

+9 -5
View File
@@ -387,7 +387,9 @@ var ReactMount = {
'_renderNewRootComponent(): Render methods should be a pure function ' +
'of props and state; triggering nested component updates from ' +
'render is not allowed. If necessary, trigger nested updates in ' +
'componentDidUpdate.'
'componentDidUpdate. Check the render method of %s.',
ReactCurrentOwner.current && ReactCurrentOwner.current.getName() ||
'ReactCompositeComponent'
);
var componentInstance = instantiateReactComponent(nextElement, null);
@@ -569,10 +571,12 @@ var ReactMount = {
// render but we still don't expect to be in a render call here.)
warning(
ReactCurrentOwner.current == null,
'unmountComponentAtNode(): Render methods should be a pure function of ' +
'props and state; triggering nested component updates from render is ' +
'not allowed. If necessary, trigger nested updates in ' +
'componentDidUpdate.'
'unmountComponentAtNode(): Render methods should be a pure function ' +
'of props and state; triggering nested component updates from render ' +
'is not allowed. If necessary, trigger nested updates in ' +
'componentDidUpdate. Check the render method of %s.',
ReactCurrentOwner.current && ReactCurrentOwner.current.getName() ||
'ReactCompositeComponent'
);
invariant(
@@ -868,7 +868,7 @@ describe('ReactCompositeComponent', function() {
'Warning: _renderNewRootComponent(): Render methods should ' +
'be a pure function of props and state; triggering nested component ' +
'updates from render is not allowed. If necessary, trigger nested ' +
'updates in componentDidUpdate.'
'updates in componentDidUpdate. Check the render method of Outer.'
);
});