[discussion] Update ReSub to support the latest React
See original GitHub issueThe latest version of React (starting from 16.3.*) includes public API changes which will affect on the ReSub in the future.
The following methods will be removed:
componentWillMount
componentWillUpdate
componentWillReceiveProps
- has new pseudo analog,static
methodgetDerivedStateFromProps
In my opinion, the most significant change related to componentWillMount
, because ReSub uses it to set the initial state., correct me if I’m wrong.
In order to use the latest version of React with ReSub would be great to follow new API changes.
Is there any plan/ideas on how to “smoothly” update ReSub? Maybe make sense to make all changes and publish major (for instance 2.0) version in order to do not break applications which use the current version of ReSub.
What do you think @deregtd @ms-markda @berickson1?
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (15 by maintainers)
Top Results From Across the Web
How to Upgrade to React 18
To help surface these issues, React 18 introduces a new development-only check to Strict Mode. This new check will automatically unmount and ...
Read more >Versions - React
A complete release history for React is available on GitHub. Changelogs for recent releases can also be found below. Note. The current docs...
Read more >Where To Get Support - React
There are many online forums which are a great place for discussion about best practices and application architecture as well as the future...
Read more >React v18.0 – React Blog
React may start rendering an update, pause in the middle, then continue later. It may even abandon an in-progress render altogether. React ......
Read more >The Plan for React 18 – React Blog
Instead of an all-or-nothing “mode”, concurrent rendering will only be enabled for updates triggered by one of the new features. In practice, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m going to figure out a solution in a next couple days. React 16.4 already warns about methods usage, I guess we will have 3 different configuration options for different React versions.
I’m going to use 2nd for our upgrade to react-native 0.56 to don’t have too many changes and speed up the bump and as a following change - update it to 3rd.
I need to experiment with getDerivedStateFromProps a bit. If I remember correctly it is called on initial component creation and where componentWillReceiveProps and componentWillMount were called.
My understanding is that the method might be called more frequently than it used to due to the fiber related changes. I’m not sure if this part is already implemented in react. They stated that they are going to apply some optimizations which might cause multiple method calls that’s why the original methods got deprecated.
I have already done some prototyping see Pull Request. I tried not to change the API of ReSub. You cann tell me, what you think about it.