recharts / recharts

Redefined chart library built with React and D3
http://recharts.org
MIT License
24.09k stars 1.71k forks source link

Warning: componentWillReceiveProps has been renamed, and is not recommended for use. #2260

Closed Srinivasan74 closed 3 years ago

Srinivasan74 commented 4 years ago

Reproduction link

http://recharts.org/en-US/

Steps to reproduce

Any chart which I am using from Recharts package is throwing the below error.

react-dom.development.js:89 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

Please update the following components: RadialBar, RadialBarChart

What is expected?

There should be any errors and support latest version of React

What is actually happening?

This is getting into infinite loop. Once the warnings are taken care page would render correctly

Environment Info
Recharts v1.8.5
React "react": "^16.12.0"
System Windows10
Browser Google Chrome Version 84.0.4147.135

Recharts is used in almost all the screens from where the data is rendered. If this is not resolved immediately might have to look for different packages.

ckifer commented 4 years ago

Duplicate of #1835 #2015 #2102 and https://stackoverflow.com/questions/58465376/react-hooks-using-recharts-areachart-console-warning

@Srinivasan74 This has been fixed in 2.0.0-beta.6

If this is an issue maybe look for another library, Recharts hasn't been very active as of late

redbmk commented 4 years ago

@ckifer I just tried 2.0.0-beta.7 and I'm no longer getting a warning about componentWillReceiveProps but am instead getting an error that Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. So it sounds like the fix was just to add UNSAFE_?

I've really enjoyed working with Recharts in the past and was hoping to use it again on a new project. I think it's a great project, but it's too bad it's not been very active lately. I'd gladly help out if I had enough free time. Any recommendations for similar projects with more active maintenance?

ckifer commented 4 years ago

@redbmk not sure about the errors, I never got them as I used Recharts...but yeah that'll have to be refactored eventually.

Other libs: React based: https://github.com/airbnb/visx https://formidable.com/open-source/victory/ https://github.com/uber/react-vis https://nivo.rocks/

JS Based with React Wrappers: Highcharts (paid) Echarts Chart.js etc...