today I want to ask how it would be possible to start an animation from a button onPress event using React Native Reanimated 2? I want to call entering animation like that but it does not work? It looks like i am using useref
wrong. My code so far -
const refAnimated = useAnimatedRef();
.
.
.
<Animated.View
ref={refAnimated}
entering={LightSpeedInRight.duration(600)
.delay(600)
.springify()
.damping(15)}
style={[styles.box, animationStyle]}
/>
<Button
title="start"
onPress={() => {
refAnimated.current.LightSpeedInRight();
}}
/>
I have simple Animated.View and a button. When i press the button i want the animation to start again but i get the following error
TypeError: undefined is not an object (evaluating 'refAnimated.value.LightSpeedInRight')
So how can i use ref with reanimated 2?