<p dir="auto"><strong>bug - getDerivedStateFromProps is invoked after change state in the same component</strong></p>
<p dir="auto">CodeSandbox ( <a href="https://codesandbox.io/s/8k1v8xjq68" rel="nofollow">https://codesandbox.io/s/8k1v8xjq68</a> )<br>
In my example you can see, that the ElementOne clear state after change state in this component, because  the static function getDerivedStateFromProps is invoked (In the guide is: The static getDerivedStateFromProps lifecycle is invoked after a component is instantiated as well as when it <strong>receives new props</strong>. -&gt; ElementOne received new state.). ElementTwo is same with component willReceiveProps, but this behavior is ok.</p>
<p dir="auto">react 16.4<br>
react-dom 16.4</p>
<p dir="auto">According to semver, only non-breaking changes are supposed to go into minor and patch version releases. With the release of 16.4, you have made breaking changes to <code class="notranslate">getDerivedStateFromProps</code>. Our entire codebase, running perfectly on 16.3.2 is a dumpster fire as soon as we raise that dependency to 16.4.</p>
<p dir="auto">The only thing in your CHANGELOG about this <em>breaking</em> change is:</p>
<blockquote>
<p dir="auto">Properly call getDerivedStateFromProps() regardless of the reason for re-rendering. (<a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/acdlite/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/acdlite">@acdlite</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="313087680" data-permission-text="Title is private" data-url="https://github.com/facebook/react/issues/12600" data-hovercard-type="pull_request" data-hovercard-url="/facebook/react/pull/12600/hovercard" href="https://github.com/facebook/react/pull/12600">#12600</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="322993706" data-permission-text="Title is private" data-url="https://github.com/facebook/react/issues/12802" data-hovercard-type="pull_request" data-hovercard-url="/facebook/react/pull/12802/hovercard" href="https://github.com/facebook/react/pull/12802">#12802</a>)</p>
</blockquote>
<p dir="auto">Please revert this change and save it for 17.0.0, or provide proper documentation to what this change actually entails so that its use can be adjusted by those who have already implemented <code class="notranslate">getDerivedStateFromProps</code>.</p>