-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React 16.9 Deprecation *Will* warning #1374
Comments
That can't be right, because we stopped using Please double-check the library versions you actually have installed in your app. |
I'm seeing this with the Provider component as well. breadcrumbs.js:76 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.
Please update the following components: Provider |
Well, as you can see, So, whatever you're seeing, it's not due to our current version. We removed all the deprecated lifecycles in v6. |
Weird, it must be an error in something below it that's getting misreported or something... |
Hm... seems like really the problem was inside misversion of imported |
It must be misreporting the error based on a child having legacy context and cwrp.... |
@mikecousins in my case it was exactly so. |
Any chance of backporting the fix to the 5.x series (or even, for the moment, the |
@elyobo : we tried to update the code to get rid of the lifecycle warnings as a 5.x release, and that failed completely. So, the "fix" was a complete rewrite, first in v6 and then in v7. Nothing we can backport. We might be able to do a rename to UNSAFE and put out a 5.x patch, but the real answer is you should stop using v5 and update to v7. We're not responsible for Enzyme's inability to keep up with React. Your other option, of course, would be to stay on React 16.8 to avoid the warnings. |
Also, adding UNSAFE_ prefixes would break support for React 15 and 0.14. We're facing the same issue on React Router. I'm not sure there's a good fix yet. |
@elyobo : based on Twitter responses, I'm not clear on what the limitations are with context and Enzyme. It sounds as if it ought to be supported with https://twitter.com/dan_abramov/status/1164158172673794048 Either way, though, you really should update to v7. |
It's not a "thing" per se. Shallow rendering renders one level deep. Context by definition adds a level. So you can't really expect it to work if you use shallow rendering. My suggestion would be to not use shallow rendering. |
Thanks @markerikson for your response and @gaearon for chipping in as well. I'm not using shallow rendering, my issues are with
The linked issue enzymejs/enzyme#1553 has several issues mentioned for the new context API but as far as I can see it's still not complete. Specifically with regards to this
If it was done naively then yes it would break support for earlier React, but I was envisaging some sort of feature detection that would identify which version of the lifecycle event it should use based on the React version in use and that could therefore maintain backwards compatibility as well. Not sure if that's viable? I'd like to upgrade, but the options don't look great (dropping a lot of tests, or possibly rewriting them using one of the other test libs) and so my inclination is to stick with an Reducing the noise of the warning, and providing EDIT Detecting the react version in use and using the right name seems like it would be straightforward enough in |
☝️ Added an example of how feature detection in the 5.x branch could work to support both older and newer React versions without the noise and with forward compatibility for React 17.x. |
hmh, we have
|
Same issue for me as @AndyOGo even after updating to ^7.1.0 |
Again, I can confirm that this is not a problem with React-Redux in v7, because we do not use these lifecycle methods. This is some kind of false positive. |
@AndyOGo @pprachit09 did you ever find a solution to this? I know this isn't react-redux's fault at all, since there is nowhere these deprecated methods are being used.. Is there a known false-positive documented react bug that people are aware of? I'm running react |
It seems to just misreport one of it's parents sometimes. For me it was the react-stripe-elements library that was causing the actual issue which was a child of my Provider component. |
Ah thanks, good call - bumping |
And you should move to @react/stripe-js instead as react-stripe-elements is deprectated now 👍 |
If you see it misreporting a component, please file an issue with a reproducing case in React. |
Here's a replication sandbox, I'll open an issue in React as well. |
I dug into this more and I think it's because inside the react-stripe-elements library their component is named Provider as well.... |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
React throw a warning about all deprecated WILL methods inside react-redux.
Example: https://i.ibb.co/mbWrWYC/Screen-Shot-2019-08-09-at-11-06-13-AM.png
What is the expected behavior?
As long as React works on cut out deprecation methods, this package (react-redux) should also be up to date with.
Which versions of React, ReactDOM/React Native, Redux, and React Redux are you using? Which browser and OS are affected by this issue? Did this work in previous versions of React Redux?
React: 16.9.0
Redux: 16.9.0
React-Redux: 7.1.0
The text was updated successfully, but these errors were encountered: