React-select: Warnings: componentWillReceiveProps in strict mode, Legacy context API, findDOMNode is deprecated

Created on 18 Jun 2020  Â·  16Comments  Â·  Source: JedWatson/react-select

_This issue is a round-up of multiple past issues documenting the same bug. Feel free to check out the linked issues below for more information. This issue is the source of truth going forward to investigate the issue, report findings, and implement a bug fix._

Issue:

W35yYs

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.
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.
Warning: 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

Issues:

https://github.com/JedWatson/react-select/issues/3751
https://github.com/JedWatson/react-select/issues/3720
https://github.com/JedWatson/react-select/issues/3915
https://github.com/JedWatson/react-select/issues/3745
https://github.com/JedWatson/react-select/issues/4068
https://github.com/JedWatson/react-select/issues/3703

If anyone would like to share any further information, please do so.

issubug-confirmed issureviewed

Most helpful comment

For anyone else going insane over this, you can disable those warnings (and other, actually helpful ones) by commenting out <React.StrictMode> in index.js. Just remember to uncomment it a few times a day to get the helpful warnings.


Update: Stop confused-face'ing me you monsters! 😭

All 16 comments

Same issue here

same issue

So basically someone would have to create a PR and replace legacy component lifecycle methods with newer version: https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#migrating-from-legacy-lifecycles

However, looking at usages and code inside of _UNSAFE_componentWillReceiveProps_ , it might not be so straightforward.

same issue

For anyone else going insane over this, you can disable those warnings (and other, actually helpful ones) by commenting out <React.StrictMode> in index.js. Just remember to uncomment it a few times a day to get the helpful warnings.


Update: Stop confused-face'ing me you monsters! 😭

Same issue here.

Hello! The problem is not solved yet? :(

Can anyone say - are these warnings critical and can we expect the developers to fix that in the future?

@OlegPuzankin They aren't critical in React 16.x.x, in React 17+ I suspect all the deprecated UNSAFE_xyz methods will be removed so any libraries depending on those methods will stop working.

Yes, the maintainer is aware of it and has it on their todo list.

React v17 has been released. Someone please fix this issue

The UNSAFE removal has been deferred to React 18.

I've started a fork of react-select. Feel free to resubmit this issue on the fork and/or submit a PR to resolve this issue on the fork and we can get it merged and released.

EDIT: :tada: I've archived the fork now that we've got some momentum in this repo and Jed is involved again. Sorry for the disturbance!

@Methuselah96 Is that a drop-in replacement that won't spam the UNSAFE warnings?

Edit: Seems to have the same UNSAFE warnings and others are submitting PRs to that project... so... why not just PR this project instead? 🤔

@corysimmons I haven't finished the changes necessary to remove the UNSAFE warnings in the fork.

I didn't make a PR for this project, because at the time, it had been several months since any PR had been merged and half a year since a new version had been released. I planned on creating a PR once I had finished all the changes necessary.

As long as this project is actually maintained, I'll make PRs here and hopefully archive my fork.

EDIT: I've made a PR: https://github.com/JedWatson/react-select/pull/4313.

Thanks for your efforts!

On Wed, Nov 25, 2020 at 2:33 PM Nathan Bierema notifications@github.com
wrote:

@corysimmons https://github.com/corysimmons I haven't finished the
changes necessary to remove the UNSAFE warnings in the fork.

I didn't make a PR for this project, because at the time, it had been
several months since any PR had been merged and half a year since a new
version had been released. I planned on creating a PR once I had finished
all the changes necessary.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/JedWatson/react-select/issues/4094#issuecomment-733933243,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAEYL5RGUSQDUWO7JONCTCTSRVSX3ANCNFSM4OBIGG7Q
.

Have the same issue here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

geraldfullam picture geraldfullam  Â·  3Comments

jonorogers picture jonorogers  Â·  3Comments

batusai513 picture batusai513  Â·  3Comments

mbonaci picture mbonaci  Â·  3Comments

Meesam picture Meesam  Â·  3Comments