Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking React 17 changes #1035

Closed
chaffeqa opened this issue Jul 13, 2018 · 4 comments
Closed

Breaking React 17 changes #1035

chaffeqa opened this issue Jul 13, 2018 · 4 comments

Comments

@chaffeqa
Copy link

chaffeqa commented Jul 13, 2018

Is your feature request related to a problem? Please describe.
A lot of lifecycle + server side rendering changes are occurring in React 16. It would be nice to have a branch of RNW that builds towards those changes (and is a breaking version change that supports react: ^0.16)

Describe alternatives you've considered
It is hard to do stuff like render = React.version.minor >= 16 ? ReactDom.hydrate : ReactDom.render

Additional context
A sep branch would be nice because the changes of all component lifecycles to the new approach I'm sure will take time, and need to trace changes to the master branch

[Edit]
I realized that you swap hydrate for render based on process.env.NODE_ENV. Maybe for the time being would you consider allowing to pass in a renderFn so users can default to hydrate?

Related Warning:
screenshot 2018-07-13 05 20 18

@necolas
Copy link
Owner

necolas commented Jul 13, 2018

Link to the changes?

@chaffeqa
Copy link
Author

chaffeqa commented Jul 13, 2018

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html

One of the biggest lessons we’ve learned is that some of our legacy component lifecycles tend to encourage unsafe coding practices. They are:

  • componentWillMount
  • componentWillReceiveProps
  • componentWillUpdate

16.3: Introduce aliases for the unsafe lifecycles, UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps, and UNSAFE_componentWillUpdate. (Both the old lifecycle names and the new aliases will work in this release.)

A future 16.x release: Enable deprecation warning for componentWillMount, componentWillReceiveProps, and componentWillUpdate. (Both the old lifecycle names and the new aliases will work in this release, but the old names will log a DEV-mode warning.)

17.0: Remove componentWillMount, componentWillReceiveProps, and componentWillUpdate . (Only the new “UNSAFE_” lifecycle names will work from this point forward.)

@necolas
Copy link
Owner

necolas commented Jul 13, 2018

Oh I thought it was something new. I'm aware of this, thanks. I don't think a branch is necessary

@necolas necolas closed this as completed Jul 13, 2018
@dcalhoun
Copy link
Contributor

dcalhoun commented Nov 1, 2019

@necolas are your intentions to address these deprecations within #1172 or somewhere else? Are you interested in me opening a PR adding the UNSAFE_ prefix to suppress the current warnings from using RNW with React >=16.9.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants