You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Warnings: componentWillReceiveProps in strict mode, Legacy context API, findDOMNode is deprecated #4094
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:
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
If anyone would like to share any further information, please do so.
Reacted by Matthew Reishus, Nathan Shelly, Meriadec Pillet, Christoph Haag, Tom Crockett, Duma, Cory Simmons, Brandon T. Kowalski, Francesco, Can Küçükyılmaz and 71 more
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! 😭
Reacted by Estefan, Gian Grassi, Vinícius Fraga Modesto, Celo Reis, alongalperin, xuan, Barak, Ryan Milton, David Öhlin, Jessica and 6 more
Reacted by Henrik Myntti, Zahid Saeed, Nikolai Gorte, Justin Leider, Washington Soares, Zach Silveira, Jhony Penagos, Josh Cole, Bernt Christian Egeland, Murat BEŞER and 19 more
Reacted by David Öhlin, Laura Juo-Hsin Chen, Breno Baptista, milad geravand, Edoardo L'Astorina, Bhavin Agarwal, jwrightEA and Hasibullah Mahmood
Reacted by Guilherme de Oliveira Costa, Vinícius Fraga Modesto, hellgatex31, Sean Washington, Misael, Celo Reis, Sergio A. Trejo, Brandon T. Kowalski, James, Juan Pablo Solano and 74 more
@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.
Reacted by bwilson, Abhijeet Singh, Anton Lvovych, Yoav, code-jongleur, Gal Bracha and Dezzymei
React v17 has been released. Someone please fix this issue
Reacted by Shyam Gupta, Ben Kirchner, Lucas Viegas, Cássio Lacerda, Paulo Carvalho, Javier Cestau, cedricfarinazzo, Ismael Barrios R, omaksi, Goga Gogoberishvili and 10 more
Reacted by Meriadec Pillet, Ilham, Thomas LEDUC, Ante and Rishi Tank
@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.
Reacted by Finn O'Connor, Bernt Christian Egeland, Meriadec Pillet, Nahuel Krowicki, Cory Simmons, Matheus de Castro Diori, Justin Leider, Jawwad Zafar, Jody Heavener, Eric and 5 more
Reacted by Bernt Christian Egeland, Nahuel Krowicki, Zach Wegrzyniak, Cory Simmons, Dollique, Jose Padilla, Dezzymei and Adam Clemons
Activity
giangr21 commentedon Jun 18, 2020
Sine99 commentedon Jun 19, 2020
manvydasu commentedon Jun 19, 2020
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.
stak99 commentedon Jun 28, 2020
corysimmons commentedon Jun 29, 2020
For anyone else going insane over this, you can disable those warnings (and other, actually helpful ones) by commenting out
<React.StrictMode>inindex.js. Just remember to uncomment it a few times a day to get the helpful warnings.Update: Stop confused-face'ing me you monsters! 😭
martijnhalekor commentedon Jul 15, 2020
roberto-souza commentedon Jul 20, 2020
OlegPuzankin commentedon Jul 24, 2020
Can anyone say - are these warnings critical and can we expect the developers to fix that in the future?
corysimmons commentedon Jul 24, 2020
@OlegPuzankin They aren't critical in React 16.x.x, in React 17+ I suspect all the deprecated
UNSAFE_xyzmethods 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.
BraveEvidence commentedon Oct 24, 2020
React v17 has been released. Someone please fix this issue
2 remaining items
corysimmons commentedon Nov 25, 2020
@Methuselah96 Is that a drop-in replacement that won't spam the
UNSAFEwarnings?Edit: Seems to have the same
UNSAFEwarnings and others are submitting PRs to that project... so... why not just PR this project instead? 🤔Methuselah96 commentedon Nov 25, 2020
@corysimmons I haven't finished the changes necessary to remove the
UNSAFEwarnings 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.
bwilson commentedon Nov 25, 2020
flora8984461 commentedon Dec 2, 2020
Have the same issue here.
Dezzymei commentedon Jan 18, 2021
I am still getting this issue. I thought this was working with react 17?
corysimmons commentedon Jan 22, 2021
@Methuselah96 Thank you, Hero!
Ochaun commentedon Feb 25, 2021
Still getting this issue on 4.1.0 for the Animated Select.
ebonow commentedon Feb 25, 2021
@Ochaun this is being tracked in #4456
Update react-select