Skip to content

Apply delays per component using single shared value #6596

Answered by MatiPl01
Saphirah asked this question in Q&A
Discussion options

You must be logged in to vote

Hey!

As I understand, be saying that the animation is synced you mean that the animation should be triggered at the same time for all of your range sliders, right?

I think that you cannot do this easily when you have a single (shared) progress value. Each range slider should have an independent progress as the delay affects its animation progress.

The easiest approach would be to have just one shared value that triggers the animation, such as:

const isAnimating = useSharedValue(false);

// Set to true when you want your animation to start
isAnimating.value = true;

And then, in your range slider components:

export default function RangeAnimation(props: {isAnimating: SharedValue<boolean>, d…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Saphirah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants