Skip to content

Commit

Permalink
Remove irrelevant suggestion of a legacy method from a warning (#13169)
Browse files Browse the repository at this point in the history
* Edit warn message what use deprecated lifecycle method

* delete setState warn message about prescriptive and deprecated life cycle

* fix lint

* Prettier

* Formatting
  • Loading branch information
Brew-Brew authored and gaearon committed Aug 2, 2018
1 parent fddb236 commit 6db0801
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ describe('ReactCompositeComponent', () => {
instance = ReactDOM.render(<Component />, container);
}).toWarnDev(
'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`.',
'`render`). Render methods should be a pure function of props and state.',
{withoutStack: true},
);

Expand Down
4 changes: 1 addition & 3 deletions packages/react-reconciler/src/ReactFiberScheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ if (__DEV__) {
warningWithoutStack(
false,
'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`.',
'`render`). Render methods should be a pure function of props and state.',
);
didWarnAboutStateTransition = true;
break;
Expand Down

0 comments on commit 6db0801

Please sign in to comment.