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

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:

#3751
#3720
#3915
#3745
#4068
#3703

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

16 Answers

✔️Accepted Answer

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

Other Answers:

@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: #4313.

React v17 has been released. Someone please fix this issue

The UNSAFE removal has been deferred to React 18.

@Methuselah96 Thank you, Hero!

Related Issues:

187
react select onChange returns the selected value, not the complete event
@ashnur I'm going to address your comment for the benefit of anyone else who is seeking to understan...
116
react select React Select [v2] focus outline color
@Iulia-Soimaru you can style the borderColor via props like: Hi i want to change the focus outline c...
97
react select How to force reload of options?
This works for me: Example working: https://github.com/helmarjunior/react-hooks-select-async ...
64
react select v3 upgrade guide
Would be awesome if you could update typings for this too Currently don't believe I can import like ...
42
react select [V2] Warning: Prop id did not match.
I think it's instanceId prop not id prop? Getting this error in console Warning: Prop id did not mat...
33
react select How to set value on version 2?
Was thinking the same took me a bit From what I can tell you have to set the value to the object of ...
25
react select How to keep value in textbox search after choosing it
@DaveOdden (and others) For V2- I was able to enable editable text by setting the inputValue prop on...
25
react select Warnings: componentWillReceiveProps in strict mode, Legacy context API, findDOMNode is deprecated
For anyone else going insane over this you can disable those warnings (and other actually helpful on...
23
react select Add isOpen Prop
isOpen or alwaysOpen is really important property Sometimes we need it We all can make a fork to add...
15
react select Select doesn't render isomorphically
Use instanceId: <Select instanceId=unique name ...> Hello If I render this server side first and the...
11
react select Uncaught TypeError: Object(...) is not a function
Sorry I meant to follow up here when we resolved this over email The issue was with the Webpack conf...
10
react select textbox input clears after selecting a value from the options using redux and onInputChange returns empty even if returning the value.
I had to make the following changes to get our search working as expected: Using redux and react-sel...
9
react select Select in IOS doesn't work
Thanks for your reply I fixed it - in my case 'fastclick' lib causes that issue ...
9
react select Cursor lagging input
I also experience some sort of this bug in IE11 When you type relatively fast the input jumps back a...
8
react select Critical accessibility issues: aria roles and aria-label
For anyone else who stumbles upon this thread and is looking for a temporary fix.. ...
6
react select Styles are not applied to react-select inside a shadow-DOM component
@JedWatson we add additional check and now it works Can you update your package? ...
5
react select Multi labelKey or custom labelKey
Maybe labelKey can receive a function: That would be awesome! Hello ...
5
react select Feature Request: Allow for sorting options in filterOptions prop
Meanwhile i had to do something like this: Hope it helps someone In v1 overriding the standard filte...
5
react select How to specify labelkey and valuekey in version 2.1.1
You forgot to actually ask your question (which should really go to StackOverflow in this scenario) ...