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-dock: componentWillReceiveProps with react 16.9.0 #630

Closed
ukch opened this issue Sep 7, 2020 · 2 comments
Closed

react-dock: componentWillReceiveProps with react 16.9.0 #630

ukch opened this issue Sep 7, 2020 · 2 comments

Comments

@ukch
Copy link

ukch commented Sep 7, 2020

Ref: alexkuz/react-dock#40

For quite some time, React has been throwing up a warning about this component using the deprecated componentWillReceiveProps interface. The simplest solution here is to do a find-replace and use UNSAFE_componentWillReceiveProps instead. Alternatively, you could refactor the component to use getDerivedStateFromProps instead.

Here's the full warning from React:

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles 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: Dock

@Methuselah96
Copy link
Member

I resolved this in the PR that added this package. This issue should be resolved in react-dock@0.3.0, which I released just now. Let me know if that doesn't resolve your issue.

@ukch
Copy link
Author

ukch commented Sep 8, 2020

Thanks @Methuselah96 . I can confirm the issue appears to be fixed in the new version.

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