-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 - Warning: componentWillMount has been renamed, and is not recommended for use. #1835
Comments
The maintainer is looking for contribs #1833 I'm curious if React 16 will be the supported target. If so, then we can remove /replace all the deprecated lifecycle methods. |
https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#gradual-migration-path React 16.3 introduces the |
Hi guys, I'm glad to help with this "small" code update.
|
@semoal actually the ideal solution in the long term is not to move to That's a clear path and future-proof approach, but I well understand that brings a lot of codebase rewrite. |
Till the time you aren't moving recharts to hooks, at least, these unsafe methods need to be refactored, they show long warnings in the console. |
I agree with @paramsinghvc , maybe do an interim fix and plan for a larger refactor in the coming major release? |
@damianobarbati - Hooks aren't the only way to do things. There are still things that require lifecycle methods, and there is no current plans to depreciate the current lifecycle methods. They are used extensively within the Facebook codebase. Updating some/all the components to hooks may help simplify some of the components, but isn't need at all for React 17 compatibility. The main issue here is @xile611 is asking for maintainers (which is fine) but hasn't appointed anyone yet and isn't around to approve PRs. |
Thanks for merging @xile611. Sadly I am still getting an error on one of the dependencies of recharts. It seems the Animate component from react-smooth still has a componentWillReceiveProps. There is a PR on the react-smooth library from recharts: recharts/react-smooth#29 |
The maintainer has had tried to migrate the deprecated lifecycles to others like The changes have ultimately reverted in a later release and a full conversion is planned but will take quite an amount of time. |
Considering that changing all of these lifecycle methods it's not that easy/quick, i would suggest, for now, the addition of the That way, we get rid of the warnings with no major changes in the codebase and when React 17 is released, at least the deprecation of these methods won't be a breaking change, even though they would need to be refactored later. UPDATE: I just noticed that #1905 already applied this fix and has been merged. |
It looks like this was fixed in #1905 then rolled back due to a problem supporting react@15 with the Is there any path forward to resolve these warnings in react@16 that is still compatible with react@15 @xile611? I'd be happy to contribute a PR with a bit of guidance on how to best resolve this. |
Can we drop support for react 15
…On Tue, Oct 29, 2019, 2:19 PM Mike Guida ***@***.***> wrote:
It looks like this was fixed in #1905
<#1905> then rolled back due to
a problem supporting ***@***.*** with the UNSAFE_ prefix (8ae2390
<8ae2390>
).
Is there any path forward to resolve these warnings in ***@***.*** that is
still compatible with ***@***.*** @xile611 <https://github.com/xile611>?
I'd be happy to contribute a PR with a bit of guidance on how to best
resolve this.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1835?email_source=notifications&email_token=AAQGPCR2ZW6AOUAZCDLJ45DQRB5E3A5CNFSM4IKUYUUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECRSG3Y#issuecomment-547562351>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQGPCU7T7NXITCRYEZY32LQRB5E3ANCNFSM4IKUYUUA>
.
|
Still getting the warning when using ComposedChart, Line components. |
@josephmaxim Of course you do, did you even read the posts above? |
Perhaps reopen the issues as it's resurfaced? |
Yes, seeing this again |
It's a bit hacky and I have no idea how safe this is but this seems to be fixed in the v2 beta:
or
|
@mikefrancis probably safe. we should all test and report any issues. the beta also fixes use of core-js 2.x (whereas |
@avindra hopefully v2 will be released soon then 🤞 |
any status updates on a stable v2 release date? |
Do you want to request a feature or report a bug?
Reporting a bug. This should simply require a small code update if we want to leave the unsafe lifecycle methods. That something I can make a PR for but I didn't know if this would be good time to move away from these lifecycle methods all together.
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: http://jsfiddle.net/ndLhnegs/).
Create React Project with React@16.9 or greater and then install recharts and attempt to render a chart.
What is the expected behavior?
No warnings.
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
Recharts@1.7.0
The text was updated successfully, but these errors were encountered: