react-native-reanimated-carousel icon indicating copy to clipboard operation
react-native-reanimated-carousel copied to clipboard

Layout animation on data change

Open OneLoneFox opened this issue 3 years ago • 0 comments

Hello, is there any way to animate the carousel items into their new positions when the data changes.

P.S. I'm new to the react native ecosystem so if there are already any resources I should be looking at I would also apreciate it.

OneLoneFox avatar Jul 21 '22 20:07 OneLoneFox

https://github.com/dohooo/react-native-reanimated-carousel/blob/main/docs/props.md#ref

useEffect(()=>{
    ref.current.scrollTo({index:0,animated:true})
},[data])

dohooo avatar Aug 12 '22 04:08 dohooo

I think they mean layout transitions when adding/removing items from the carousel.

layday avatar Aug 12 '22 06:08 layday

Hello, is there any way to animate the carousel items into their new positions when the data changes.

This is a complicated logic. First, how do we define where the current element should be?

dohooo avatar Aug 12 '22 07:08 dohooo

I think they mean layout transitions when adding/removing items from the carousel.

uhh, I don’t think so 🧐

dohooo avatar Aug 12 '22 07:08 dohooo