dillon1000/react

Commit

Deduplicated many warnings (#11140) (#11216)

*  Deduplicated many warnings (#11140)

*  Deduplicated the following warnings:

1.  Can only update a mounted or mounting component.
    This usually means you called setState, replaceState,
    or forceUpdate on an unmounted component. This is a no-op

2.  %s.componentWillReceiveProps(): Assigning directly to
    this.state is deprecated (except inside a component's
    constructor). Use setState instead.'

3.  An update (setState, replaceState, or forceUpdate) was scheduled
    from inside an update function. Update functions should be pure,
    with zero side-effects. Consider using componentDidUpdate or a
    callback.

4.  setState(...): Cannot call setState() inside getChildContext()

* Code review changes made for #11140

* Minor style fix

* Test deduplication for noop updates in server renderer

* Test deduplication for cWRP warning

* Test deduplication for cWM setState warning

* Test deduplication for unnmounted setState warning

* Fix existing Flow typing

* Test deduplication for invalid updates

* Test deduplication of update-in-updater warning
Browse files
Changed paths10 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js ModifiedM packages/react-dom/src/__tests__/ReactCompositeComponent-test.js ModifiedM packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js ModifiedM packages/react-dom/src/__tests__/ReactServerRendering-test.js ModifiedM packages/react-dom/src/server/ReactPartialRenderer.js ModifiedM packages/react-reconciler/src/ReactFiberClassComponent.js ModifiedM packages/react-reconciler/src/ReactFiberScheduler.js ModifiedM packages/react-reconciler/src/ReactFiberUpdateQueue.js ModifiedM packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js ModifiedM packages/react/src/ReactNoopUpdateQueue.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…