question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[discussion] Update ReSub to support the latest React

See original GitHub issue

The 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 method getDerivedStateFromProps

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:closed
  • Created 5 years ago
  • Comments:20 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
dryganetscommented, Jul 7, 2018

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.

  1. As is. for react < 16.3, marked as deprecated
  2. Unsafe methods version for react < 17, marked as will be deprecated soon
  3. Static life cycle version recommended for usage

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.

0reactions
BiggA94commented, Oct 11, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found