react-select icon indicating copy to clipboard operation
react-select copied to clipboard

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

Open bladey opened this issue 6 years ago • 20 comments

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.

bladey avatar Jun 18 '20 06:06 bladey

Same issue here

giangr21 avatar Jun 18 '20 13:06 giangr21

same issue

Sine99 avatar Jun 19 '20 14:06 Sine99

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.

manvydasu avatar Jun 19 '20 16:06 manvydasu

same issue

stak99 avatar Jun 28 '20 03:06 stak99

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! 😭

corysimmons avatar Jun 29 '20 14:06 corysimmons

Same issue here.

martijnhalekor avatar Jul 15 '20 09:07 martijnhalekor

Hello! The problem is not solved yet? :(

roberto-souza avatar Jul 20 '20 18:07 roberto-souza

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

OlegPuzankin avatar Jul 24 '20 19:07 OlegPuzankin

@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.

corysimmons avatar Jul 24 '20 20:07 corysimmons

React v17 has been released. Someone please fix this issue

BraveEvidence avatar Oct 24 '20 10:10 BraveEvidence

The UNSAFE removal has been deferred to React 18.

ljharb avatar Oct 24 '20 15:10 ljharb

~~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 avatar Nov 14 '20 16:11 Methuselah96

@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 avatar Nov 25 '20 18:11 corysimmons

@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.

Methuselah96 avatar Nov 25 '20 20:11 Methuselah96

Thanks for your efforts!

On Wed, Nov 25, 2020 at 2:33 PM Nathan Bierema [email protected] 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 .

bwilson avatar Nov 25 '20 20:11 bwilson

Have the same issue here.

flora8984461 avatar Dec 02 '20 22:12 flora8984461

I am still getting this issue. I thought this was working with react 17?

Dezzymei avatar Jan 18 '21 17:01 Dezzymei

@Methuselah96 Thank you, Hero!

corysimmons avatar Jan 22 '21 14:01 corysimmons

Still getting this issue on 4.1.0 for the Animated Select.

Ochaun avatar Feb 25 '21 18:02 Ochaun

@Ochaun this is being tracked in https://github.com/JedWatson/react-select/issues/4456

ebonow avatar Feb 25 '21 18:02 ebonow