Milad Barazandeh
Milad Barazandeh

Reputation: 331

Middle tab button using react-navigation version 5

I need to add a middle button to the app's tab navigator. It's easy to implement this feature using react-navigation 3, However, react-navigation 5, has a different structure and I couldn't find anyway to insert a custom button or component inside navigator.

const Tab = createBottomTabNavigator();

const TabNavigator = props => {
    return (
        <NavigationContainer>
            <Tab.Navigator>
                <Tab.Screen name="Screen1" component={FirstScreen} />
                <Tab.Screen name="Screen2" component={SecondScreen} />

                {...here...}

                <Tab.Screen name="Screen3" component={ThirdScreen} />
                <Tab.Screen name="Screen4" component={ForthScreen} />
            </Tab.Navigator>
        </NavigationContainer>
    );
}

What can I do? Any help will be really much appreciated!

Upvotes: 1

Views: 419

Answers (1)

Shijesh P
Shijesh P

Reputation: 89

You can use the navigationOptions pros inside the Tab.screen tag and create your own custom view same as old version.

Upvotes: 1

Related Questions