Hotfix: Revert all UNSAFE_ lifecycle methods #4078
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The addition of the
UNSAFE_
lifecycle methods broke React 15 compatibility. Those methods are not intended for libraries still supporting React 15.The only way to remove the React 16.4+
StrictMode
warnings aboutcWM
,cWRP
, andcWU
in a React 15 compatible way is to migrate these methods to the new lifecycle methods and usereact-lifecycles-compat
for backwards compatibility. TheUNSAFE_
methods were to support application authors with a known target version of React (16.3+) from having to migrate every component before upgrading. Unfortunately we can't do that trick.Additional Testing
Since the automated tests are all run against React 16, I've confirmed this locally by building my fork, and copying the
lib
folder tonode_modules/redux-form
of a download of this sandbox which is against 15.6, and confirming that the initialValues (as per #4069) are now showing. That's the only test I've run.Should fix
#4069, #4070, #4072