withRepeat
using array will not reverse
#6799
Labels
Platform: Android
This issue is specific to Android
Platform: iOS
This issue is specific to iOS
Repro provided
A reproduction with a snippet of code, snack or repo is provided
Description
A shared value which contains a number array will not behave as expected with a withRepeat hook.
If the parameters of the withRepeat hook are set to reverse, the sharedValue will increment to the desired value correctly, but then instead of reversing back to the original value, it will remain.
I have checked the behaviour with object ( {x:0} ) and number values, and they behave as expected.
I did some limited debugging, and I observe that the repeat animation.startValue is referentially the same as the nextAnimation.current when an array is used during the "forward" part of the animation, but when an object or a number is used the value reference is different (within /packages/react-native-reanimated/src/animation/repeat.ts)
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/@odogono/uplifting-green-waffles
Reanimated version
3.16.3
React Native version
0.76.3
Platforms
Android, iOS
JavaScript runtime
None
Workflow
None
Architecture
Fabric (New Architecture)
Build type
None
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: