react-native-reanimated: Shared element does not work for in nested navigators.
Description
When navigating from a bottom navigator to a page within another navigator, shared element transition does not work.
StackNavigator |_page1 |_page2 |_BottomNavigator –|_page3
- If the application is opened with
page1, it works when navigating topage2. - If the application is opened with
page3, it does not work when navigating topage1orpage2. In this case, it does not work when navigate frompage2topage1.
const MainStack = createNativeStackNavigator<INavigation>();
const MainStackNavigator = () => {
return (
<MainStack.Navigator>
<MainStack.Screen name="bottomTab" component={BottomTabNavigator} />
{mainNavigationScreens.map(screen => (
<MainStack.Screen key={screen.name} {...screen} />
))}
</MainStack.Navigator>
);
};
Steps to reproduce
Try shared element in nested navigators
Snack or a link to a repository
Reanimated version
3.2.0
React Native version
0.71.8
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 18
- Comments: 16 (3 by maintainers)
According to the documentation, shared transition is only available to Native Stack Navigator The transition does not support bottom tab navigator
experiencing same problem!
Until shared element transitions are supported for bottom tabs/js stack, does someone know if there is a way to do those share element transitions “by hand” for now ? (instead of using the
sharedTransitionTag)It is working fine in Android when I have a Tab navigator created using @react-navigation/bottom-tabs and have 2 screens apart from Tab Navigator in the global native stack navigator, but it is not working in IOS.