margelo / react-native-graph

📈 Beautiful, high-performance Graphs and Charts for React Native built with Skia
https://margelo.io
MIT License
2.04k stars 115 forks source link

TypeError: undefined is not a function (near '...(0, _reactNativeSkia.useDerivedValue)...') #36

Closed fariskhan563 closed 1 year ago

fariskhan563 commented 2 years ago

Hi, thanks for this amazing library.

OK so I installed the library and rendered the line chart but there was this problem that the pointer was not showing up and it was just partially stuck at the top left of the container.

To fix that I followed this fix given in #26 , where I just reverted the skia version to 0.1.123.

After implementing above fix I re-run the app and tried to render the chart but it got crash giving the following error:

` ERROR TypeError: undefined is not a function (near '...(0, _reactNativeSkia.useDerivedValue)...')

This error is located at: in AnimatedLineGraph (at LineGraph.tsx:7) in LineGraphImpl (at portfolio/index.js:663) in RCTView (at View.js:32)`

I did some investigation and found the cause of the above error, it seems like when animated={true} it crashes the App with above error but works just fine when animated={false} but I need animated=true to enable enablePanGesture.

Simulator Screen Shot - iPhone 13 - 2022-08-13 at 02 14 04

gitteraz commented 2 years ago

useDerivedValue is Deprecated in React Native Skia check this PR https://github.com/Shopify/react-native-skia/commit/867edfa59693d83e48d0c1ee09f26b1f7c8926ab

MrNapcae commented 2 years ago

same problem +

asantaelly commented 2 years ago

I encounter the same problem.

Leoputera2407 commented 2 years ago

Downgrade to RN 0.68. The older Skia module isn't compatible with RN0.69.X https://github.com/Shopify/react-native-skia/issues/624

chrispader commented 2 years ago

react-native-skia versions above 0.1.139 are not compatible with RN 0.69.

You can either upgrade to react-native-graph@0.2.0 or use react-native-skia@0.1.138.

Maybe Yarn's selective dependeny resolutions are helpful to you: https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/