genexu / react-native-pie-chart

Simple pie chart module for your React Native app
MIT License
109 stars 47 forks source link

Invariant Violation: ART has been removed from React Native. It can now be installed and imported from '@react-native-community/art' instead of 'react-native' #29

Closed yogendrajs closed 2 years ago

yogendrajs commented 2 years ago
"react-native": "0.64.2"
"react-native-pie-chart": "^1.0.13"
"@react-native-community/art": "^1.2.0"

I've recently updated my RN version along with the RNPC version to the listed above, but keep getting this error. Although, have seen there's no need to link @react-native-community/art manually. I did hope that it would work out of the box but didn't. Any possible workaround for this would be of great help. Thanks!

aidin36 commented 2 years ago

Version one is not compatible with newer react native. Can you please upgrade to the latest version? 2.0.2? The only change you need to make is changing chart_wh to widthAndHeight, as described in the README file.

yogendrajs commented 2 years ago

Hey @aidin36, thanks, updated it to 2.0.2, but still getting the following error-

Invariant Violation: [1793,"ARTShape",1,{"fill":[0,0.5137254901960784,0.7294117647058823,0.2549019607843137,1],"opacity":1,"stroke":null,"strokeCap":1,"strokeDash":null,"strokeJoin":1,"strokeWidth":1,"transform":[1,0,0,1,0,0],"d":[0,"<<NaN>>","<<NaN>>",2,"<<NaN>>","<<NaN>>",2,"<<NaN>>","<<NaN>>"]}] is not usable as a native method argument
aidin36 commented 2 years ago

Can you please post your code here? How do you create the PieChart component?

My guess is you still pass chart_wh instead of widthAndHeight.

yogendrajs commented 2 years ago

Can you please post your code here? How do you create the PieChart component?

My guess is you still pass chart_wh instead of widthAndHeight.

Hey @aidin36, you guessed it right. After making this change, it's working perfectly fine. Thanks for your time. Closing this here :)

aidin36 commented 2 years ago

Happy to help (: