You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doesn't fix#897. But lets us know what's going to break in future versions of React:
Warning: Unsafe lifecycle methods were found within a strict-mode tree:
componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Connect(Container)
componentWillUpdate: Please update the following components to use componentDidUpdate instead: Connect(Container)
Learn more about this warning here:
https://fb.me/react-strict-mode-warnings
If others want to fix this, you can use this branch as a base. Feel free to try it out!
In terms of React-Hot-Loader componentWillUpdate could not be replaced by componentDidRender, as long RHL needs to being able render "a new" Connected component, not a cached version :(
Something major should be changed.
@theKashey We may be able to use the new getSnapshotBeforeUpdate and cDU while keeping oldListeners around between the two (or going up to the top module level).
Or just not cache rendered component :)
If a new state will be calculated in getDerivedStateFromProps, then it is possible just to cancel the unnecessary render. (and react-hot-loader will bypass this cancel)
Trying to find that cached component I am talking about, and could not find anything....
Anyway - using componentDidUpdate should be ok. And why should component reconnect to the store, not just update selector?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Doesn't fix #897. But lets us know what's going to break in future versions of React:
If others want to fix this, you can use this branch as a base. Feel free to try it out!