react-navigation-shared-element icon indicating copy to clipboard operation
react-navigation-shared-element copied to clipboard

[v4] Normal react-navigation transition when using createBottomTabNavigator

Open jamesl1001 opened this issue 5 years ago • 2 comments

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",

jamesl1001 avatar May 27 '20 20:05 jamesl1001

I am getting the same thing

JeremiahUL avatar Aug 19 '20 22:08 JeremiahUL

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}/>

tharun-slarn avatar Feb 19 '21 14:02 tharun-slarn