software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.03k stars 1.31k forks source link

Shared Transition stop working after a new screen pushed on top #4632

Open booker-dragon opened 1 year ago

booker-dragon commented 1 year ago

Description

RootNativeStackNavigator |--SiblingScreen |--ParentNativeStackNavigator |-----ParentScreen |-----TransitionScreenA |-----TransitionScreenB

Im having a problem that the shared transition for TransitionScreenA and TransitionScreenB stopped working after I have pushed SiblingScreen on top of ParentNativeStackNavigator and go back

https://github.com/software-mansion/react-native-reanimated/assets/45155182/4efdcf2d-518b-4702-86a5-9606f846d565

Steps to reproduce

  1. Create nested native stack navigators
  2. Create share transition for the screens in the ParentNativeStackNavigator
  3. Push SiblingScreen on top of ParentNativeStackNavigator
  4. Go back to the previous screen
  5. Transitions stop working

Snack or a link to a repository

N/A

Reanimated version

3.3.0

React Native version

0.69.0

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 1 year ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

booker-dragon commented 1 year ago

Tried to debug and found that the react tag for the target view is updated For example, we have two views, 115 for source view and 120 for target view

After the sibling screen is pushed to the top, the target view react tag has been change, It is 115 and 140, something like that, for this reason, the react tag could not be used to retrieve the correct target view from _viewRegistry

hazirmagron commented 1 year ago

Any new insights to this? I have a similar and very weird bug occurring.

I get no Error messages, so I am assuming that the shared transition tags aren't found.

booker-dragon commented 1 year ago

Any new insights to this? I have a similar and very weird bug occurring.

I get no Error messages, so I am assuming that the shared transition tags aren't found.

My workaround is to place all the same in the same layer, so that it will not stack a higher level screen on top which cause the transition stopped

CalypsoTechLTD commented 9 months ago

Also having this issue with expo router v3 and expo SDK 50, where nested layout are just a product of the file based structure, so unfortunately I cannot use the workaround mentioned above by @booker-dragon. The only workaround I have is resetting the component with a key each time the screen is focused, but that causes obvious unnecessary re-renders and glitches. Are there any insights into this?

alaughlin commented 8 months ago

Any updates to this? Also facing this issue, seems like a legitimate bug

lemo-gizem commented 5 months ago

same issue

Bayramito commented 4 months ago

same here