I hope you're all doing well. I'm currently working on a React Native project that utilizes Reanimated 1 for animations. However, I've decided to migrate to Reanimated 2 to take advantage of its improved features and performance optimizations.
I've been trying to rewrite the code to make it compatible with Reanimated 2, but unfortunately, I'm facing some challenges, and my attempts haven't been successful so far.
I goe error
Error: Rendered more hooks than during the previous render.
Below is a snippet of the code I'm working with:
So my code in reanimated 1:
return new Animated.Value(animationHeight);
After the migration, I have modified it to use Reanimated 2 with useSharedValue:
return useSharedValue(0);
Is it correct way to replace ** animated.value** with useSharedValue?
Also i replace Animated.timing with withTiming . here is to code in reanited 2 and here is reanimated 1.