diff --git a/src/browser/ui/ReactMount.js b/src/browser/ui/ReactMount.js index 7545f2111a..8410f8e8dd 100644 --- a/src/browser/ui/ReactMount.js +++ b/src/browser/ui/ReactMount.js @@ -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( diff --git a/src/core/__tests__/ReactCompositeComponent-test.js b/src/core/__tests__/ReactCompositeComponent-test.js index c2fa177ff2..94e53a570f 100644 --- a/src/core/__tests__/ReactCompositeComponent-test.js +++ b/src/core/__tests__/ReactCompositeComponent-test.js @@ -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.' ); });