React-select: received following warning of componentWillReceiveProps has been renamed about 'Select':

Created on 9 Sep 2019  路  9Comments  路  Source: JedWatson/react-select

received following warning about 'Select':

react-dom.development.js:12029 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.
issubug-unconfirmed

Most helpful comment

Latest version of the lib is fixed fyi

I still get this warning in version [email protected]

The error message:

index.js:1 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

And when opening the dropdown I get this:

index.js:1 Warning: Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: MenuPlacer

Learn more about this warning here: https://fb.me/react-legacy-context
    in StrictMode (at Root.tsx:15)
    in Unknown (at src/index.tsx:10)

and this:

findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of NodeResolver which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node

All 9 comments

Just update my output says

 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

So both the AutosizeInput and Select components need to be updated

This is a duplicate of #3720 (referenced in #3745)

Linking this:

https://github.com/JedWatson/react-select/issues/3720#issuecomment-535120385

This is my workaround until the maintainers sort everything out.

Latest version of the lib is fixed fyi

Latest version of the lib is fixed fyi

I still get this warning in version [email protected]

The error message:

index.js:1 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

And when opening the dropdown I get this:

index.js:1 Warning: Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: MenuPlacer

Learn more about this warning here: https://fb.me/react-legacy-context
    in StrictMode (at Root.tsx:15)
    in Unknown (at src/index.tsx:10)

and this:

findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of NodeResolver which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node

Latest version of the lib is fixed fyi

I still get this warning in version [email protected]

The error message:

index.js:1 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

And when opening the dropdown I get this:

index.js:1 Warning: Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: MenuPlacer

Learn more about this warning here: https://fb.me/react-legacy-context
    in StrictMode (at Root.tsx:15)
    in Unknown (at src/index.tsx:10)

and this:

findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of NodeResolver which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node

I have the same error message of @DalderupMaurice with React 16.13.1! Have someone find a solution?

Latest version of the lib is fixed fyi

I still get this warning in version [email protected]
The error message:

index.js:1 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

And when opening the dropdown I get this:

index.js:1 Warning: Legacy context API has been detected within a strict-mode tree.

The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.

Please update the following components: MenuPlacer

Learn more about this warning here: https://fb.me/react-legacy-context
    in StrictMode (at Root.tsx:15)
    in Unknown (at src/index.tsx:10)

and this:

findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of NodeResolver which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node

I have the same error message of @DalderupMaurice with React 16.13.1! Have someone find a solution?

It's an issue within the library, using depricated code from React. This is still supported for a while, but it's detected early by React's Strict mode, which you can disable by removing the tags in your root component. However, it is not recommended to develop without the Strict mode enabled. We'd have to wait until the issue is fixed in this library

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GreenGremlin picture GreenGremlin  路  31Comments

obykoo picture obykoo  路  34Comments

dantman picture dantman  路  40Comments

OsamaShabrez picture OsamaShabrez  路  43Comments

IftekherSunny picture IftekherSunny  路  33Comments