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

React warning: outdated lifecycle methods in some components #31

Open
resolritter opened this issue Jul 3, 2020 · 2 comments
Open

React warning: outdated lifecycle methods in some components #31

resolritter opened this issue Jul 3, 2020 · 2 comments

Comments

@resolritter
Copy link

From the DevTools' Console tab

Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.
  • Rename componentWillMount to UNSAFE_componentWillMount 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: Steps, Wizard

@resolritter resolritter changed the title Refactor components using outdated lifecycles to Hooks React warning: Refactor outdated lifecycles in some components Jul 4, 2020
@resolritter resolritter changed the title React warning: Refactor outdated lifecycles in some components React warning: Refactor outdated lifecycle methods in some components Jul 4, 2020
@resolritter resolritter changed the title React warning: Refactor outdated lifecycle methods in some components React warning: outdated lifecycle methods in some components Jul 5, 2020
@resolritter
Copy link
Author

resolritter commented Jul 5, 2020

Wait, I took a look at the code now and noticed those components are exported from react-albus. There isn't a way to refactor them nicely without forking the library.

Someone recently contributed a commit which should get rid of this warning americanexpress/react-albus@528d735, thus the solution would be to simply bump react-albus' version. However, I've looked at the package's page

https://www.npmjs.com/package/react-albus

And there doesn't seem to be any activity there.

@zaguiini are you open to adding react-albus as a git dependency until this is sorted out? Or am I missing something about how NPM works?

Another option would be to migrate to a library which's actually maintained, as react-albus's repo seems to have staled in development. I might try that in an MR.

@resolritter
Copy link
Author

#32 indirectly solves this by replacing react-albus with react-step-wizard, which is actually maintained

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

1 participant