react-navigation-shared-element
react-navigation-shared-element copied to clipboard
[v4] Normal react-navigation transition when using createBottomTabNavigator
Hey there, amazing module!
I'm having problems with getting this working with a combination of stacks and bottom tabs.
I have my stack/tab structure set up like so:
const TestBottom = createBottomTabNavigator({
Test1: {
screen: Test1
},
})
const RootStack = createSharedElementStackNavigator(
{
TestBottom: TestBottom,
Test2: Test2,
},
)
const AppContainer = createAppContainer(RootStack)
My goal is to transition from Test1 to Test2.
With the current setup, the transition is the normal wipe transition from react-navigation.
If I change TestBottom: TestBottom to Test1: Test1 in the RootStack it works perfectly!
Ideally I also need Test1 and Test2 to be stacks but this seems to be the root of the problem.
I can see that you do have this setup in this example however it's not working in my case.
Any ideas?
I am using the following modules:
"react-native": "0.61.2",
"react-native-shared-element": "^0.7.0",
"react-navigation": "4",
"react-navigation-shared-element": "2.3.0",
"react-navigation-stack": "2",
"react-navigation-tabs": "^2.8.13",
I am getting the same thing
creating a separate stack for source file inside tab worked for me [V5]
Eg:
const HomeStack = createSharedElementStackNavigator(); function HomeStackScreen() { return ( <HomeStack.Navigator> <HomeStack.Screen name="Source" component={Sourcescreen} /> </HomeStack.Navigator> ); }
<Tab.Screen name="Home" component={HomeStackScreen}/>