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?
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",
}
Check #3720
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
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: https://github.com/JedWatson/react-select/issues/3751#issuecomment-570530628
+1
See also:
https://github.com/JedWatson/react-select/issues/3720#issuecomment-616069515
@razh There is currently a rewrite in progress to remove these deprecated lifecycle methods.
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.
Most helpful comment
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.