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

Migrate out of unsafe / deprecated React lifecycle methods #2384

Closed
WholeMilk opened this issue Apr 12, 2018 · 7 comments
Closed

Migrate out of unsafe / deprecated React lifecycle methods #2384

WholeMilk opened this issue Apr 12, 2018 · 7 comments

Comments

@WholeMilk
Copy link

Under React 16.3+ with React.StrictMode, several components are producing warnings in regards to unsafe React lifecycle methods usage as they will be deprecated in future React 16.x release and removed in React 17.0.

@giladgray
Copy link
Contributor

yes we've gotta do this! happy to accept PRs to convert components one-by-one.

@llorca llorca modified the milestones: 3.0.0, next May 21, 2018
@llorca
Copy link
Contributor

llorca commented May 21, 2018

Gilad: oof actually this won't happen any time soon as we still support React 15.

@phpnode
Copy link

phpnode commented Oct 29, 2018

Do you happen to know when support for React 15 will end? It is possible to polyfill the new component methods for React 15 using https://github.com/reactjs/react-lifecycles-compat if you're happy to go with that solution I'll open a PR.

@demigor
Copy link

demigor commented Nov 1, 2018

React Concurrent Rendering (16.7) will not be supported as long as old lifecycle methods have been used in Blueprint. Please, raise the prio of this issue.

@adidahiya
Copy link
Contributor

@phpnode thanks for the link, react-lifecycles-compat looks promising. I think we would like to support React 15 for a few more months, so backwards compatibility using a shim layer would be appropriate.

@adidahiya adidahiya self-assigned this Jun 26, 2019
@adidahiya adidahiya removed this from the next milestone Jun 26, 2019
@adidahiya adidahiya changed the title Migrate out of unsafe React lifecycle methods Migrate out of unsafe / deprecated React lifecycle methods Aug 19, 2019
@emlynmac
Copy link

A year has passed since this came up and we're approaching some react changes. As of today:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: Blueprint3.Spinner,  Blueprint3.OverflowList, Blueprint3.Overlay, Blueprint3.Popover, Blueprint3.QueryList, Blueprint3.Suggest, Blueprint3.Toaster, Blueprint3.Dialog, Blueprint3.Alert

@adidahiya
Copy link
Contributor

fixed by #3702, but we are still dealing with lingering semantic issues after the migration

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

No branches or pull requests

7 participants