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 : componentWillReceiveProps has been renamed, and is not recommended for use. #3745

Closed
ar5had opened this issue Aug 30, 2019 · 7 comments
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet

Comments

@ar5had
Copy link

ar5had commented Aug 30, 2019

Hi,

I am getting this warning in console. I have installed the latest version ^3.0.4 of react-select along with ^3.0.4 of @types/react-select. The warning says that - Please update the following components: AutosizeInput, Select. I tried looking for componentWillReceiveProps method in the repo, but I couldn't find any file using it. Why am I getting this warning?

@dicrescenzoa
Copy link

dicrescenzoa commented Aug 30, 2019

the same warning message is happening for jest as well.

`console.warn node_modules/react-dom/cjs/react-dom.development.js:11494
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: AutosizeInput, Select

`

package.json

{
  "react": "^16.8.6"
  "jest": "^24.8.0",
  "react-select": "^3.0.4",
}

@jarleriksen
Copy link

Check #3720

@mreishus
Copy link

Still getting warning messages as of 3.0.8. This will prevent the new react concurrent mode (not released yet) from working.

To reproduce, wrap your app in <React.StrictMode></React.StrictMode> tags.

Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. 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

Please update the following components: AutosizeInput, Select

@DalderupMaurice
Copy link

Still getting warning messages as of 3.0.8. This will prevent the new react concurrent mode (not released yet) from working.

To reproduce, wrap your app in <React.StrictMode></React.StrictMode> tags.

Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. 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

Please update the following components: AutosizeInput, Select

Same for me, wrapping it in StrictMode it is filled with warning.
See my reply here for the exact warnings: #3751 (comment)

@makker
Copy link

makker commented Apr 21, 2020

+1

@0xdevalias
Copy link

0xdevalias commented Apr 22, 2020

@bladey bladey added the issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet label Jun 3, 2020
@bladey
Copy link
Contributor

bladey commented Jun 18, 2020

Hi all,

Thank you to everyone who has provided information above.

As you may be aware, this bug has been reported multiple times as per issue #4094. On behalf of the maintainers I apologise it's taken awhile to get to this.

A new master issue #4094 has since been created to help keep track of this bug going forward.

This new issue will exist as the source of truth going forward to investigate the issue, report findings, and implement a bug fix.

We'll take into account all the details above while investigating.

If you feel this issue has been wrongly closed as it isn't related to the new master issue #4094, please let us know and we'll take another look.

Again, thank you.

@bladey bladey closed this as completed Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/bug-unconfirmed Issues that describe a bug that hasn't been confirmed by a maintainer yet
Projects
None yet
Development

No branches or pull requests

8 participants