mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Merge pull request #2946 from benmoss/nested-render-warning
Add displayName to nested render warnings [#1726]
This commit is contained in:
@@ -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.'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user