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

Warning: componentWillUpdate has been renamed, and is not recommended for use #38

Closed
FunctionDJ opened this issue Jul 31, 2021 · 5 comments

Comments

@FunctionDJ
Copy link

Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.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: Style

image

@planttheidea
Copy link
Owner

planttheidea commented Jul 31, 2021

What version are you using? The latest version (2.0.3) should no longer have this issue.

@FunctionDJ
Copy link
Author

What version are you using? The latest version (2.0.3) should no longer have this issue.

2.0.3 😔. Encountered this while using it in a codesandbox project: https://codesandbox.io/s/sleepy-sunset-56zvh.
You should be able to just open it and see it as the only warning in the console.

@planttheidea
Copy link
Owner

Looks like my previous fix was naive, and did not support React 17. I have released 2.0.4 which should resolve this issue. Let me know if there are any further issues!

@FunctionDJ
Copy link
Author

FunctionDJ commented Aug 3, 2021

It's still there, just now being reported using console.error() 😅
https://codesandbox.io/s/sleepy-sunset-56zvh

Edit: Nevermind, the original issue is gone. This error reports the usage of UNSAFE_ methods at all. Should i turn strict mode off?

@planttheidea
Copy link
Owner

Up to you, but despite the severity of the console notification it is just helpful for developers. This should not cause any issues functionality.

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

2 participants