Shopify / react-native-skia

High-performance React Native Graphics using Skia

Home Page:https://shopify.github.io/react-native-skia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Please can useSharedValueEffect be brought back?

michaelessiet opened this issue · comments

Description

Hi, I just updated to the latest Expo50 compatible version of react native skia (0.1.221) and I noticed that useSharedValueEffect is gone. This was the backbone of one of the features in my app. Are there any alternatives? As useEffect doesn't work due to the shear number of updates the useSharedValue receives when paired with the useAnimatedSensor hook.

And why is useValueEffect only allowed to accept one useValue variable as dependency? useComputed crashes the app btw

yes please check out the documentation: https://shopify.github.io/react-native-skia/docs/animations/animations
You can now pass your reanimated values directly on the UI thread.

If you are looking for more information to help you with your migration, this will help: #2083 (comment)
We understand that this is painful but:

  1. We're on the verge of marking RN Skia as stable (so such breaking change wouldn't happen so easily)
  2. You app Skia animations are gonna be much faster now.

Hope this helps, happy hacking!