0

I have a snack here where I want to take the scroll Y value and pass it to an animated view inside a sibling component and have that view animate as I scroll, for this example I just want to animate the height. Smaller when scrolling down, larger when scrolling up (doesn't matter). The snack currently passes it as state which I know is incorrect but I'm not sure how else I would achieve this.

How I can animate the component the correct way?

wind_kind
  • 561
  • 6
  • 23

1 Answers1

3

Turns out I'm overthinking it. Just use the useSharedValue hook and pass the scroll value in there then use it as a prop on the sibling component...

Here is the updated snack if anyone was wondering

wind_kind
  • 561
  • 6
  • 23