margelo / react-native-graph

📈 Beautiful, high-performance Graphs and Charts for React Native built with Skia

Home Page:https://margelo.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

fariskhan563 opened this issue · comments

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

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

same problem +

I encounter the same problem.

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

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/