Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/renderers/shared/reconciler/ReactUpdateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ function getInternalInstanceReadyForUpdate(publicInstance, callerName) {
if (__DEV__) {
warning(
ReactCurrentOwner.current == null,
'%s(...): Cannot update during an existing state transition ' +
'(such as within `render`). Render methods should be a pure function ' +
'of props and state.',
'%s(...): Cannot update during an existing state transition (such as ' +
'within `render` or another component\'s constructor). Render methods ' +
'should be a pure function of props and state; constructor ' +
'side-effects are an anti-pattern, but can be moved to ' +
'`componentWillMount`.',
callerName
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,10 @@ describe('ReactCompositeComponent', function() {
expect(console.error.calls.length).toBe(1);
expect(console.error.argsForCall[0][0]).toBe(
'Warning: setState(...): Cannot update during an existing state ' +
'transition (such as within `render`). Render methods should be a pure ' +
'function of props and state.'
'transition (such as within `render` or another component\'s ' +
'constructor). Render methods should be a pure function of props and ' +
'state; constructor side-effects are an anti-pattern, but can be moved ' +
'to `componentWillMount`.'
);

// The setState call is queued and then executed as a second pass. This
Expand Down