Bridgeless with enableFreeze: useSharedValue resets to initialValue when navigating between screens #6728
Labels
Platform: iOS
This issue is specific to iOS
Repro provided
A reproduction with a snippet of code, snack or repo is provided
Description
Wasn't sure if I should create this issue in this repo or in the react-native-screens one. But here we go!
When having
enableFreeze(true)
, useSharedValue resets to the initial value when moving to another screen within a bottom tab navigator and then back again. Since FirstScreen is not unmounted, I would expect it to keep the value at 300.Update: It seems to work (staying at 300) in RN 0.73 and in 0.74 when I disable new architecture, so it was likely introduced by the bridgeless mode.
Screen.Recording.2024-11-18.at.23.35.33.mov
Steps to reproduce
Snack or a link to a repository
https://github.com/vilindberg/reanimated-shared-value-between-stacks
Reanimated version
3.16.1
React Native version
0.76.2
Platforms
iOS
JavaScript runtime
None
Workflow
React Native
Architecture
Fabric (New Architecture)
Build type
None
Device
iOS simulator
Device model
iPhone 16 (iOS 18)
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: