简体   繁体   中英

How to implement a BottomTabNavigator in React Native?

I am NEW to React Native, and I am struggling to implement a BottomTabNavigator on my LoggedIn screen. Below is my code on my App.js file in order to implement the navigation structure, though I am having no look. Could someone kindly tell me what is wrong with the code and explain how to implement it successfully? Much appreciated.

I have two screens: LoggedIn and PostMessage.

 import React from 'react';
 import { View, Text} from 'react-native';
 import { createBottomTabNavigator } from "react-navigation-tabs";


 import PostMessage from "../screens/PostMessage";
 import LoggedIn from "../screens/LoggedIn";


const BottomTab = createBottomTabNavigator({
LoggedIn: {
screen: LoggedIn
},

 PostMessage: {
screen: PostMessage
},

});


export default BottomTab;

There seems to be a lot missing from this snippet. With that said you can look into using React Navigation 5. It really very simple to use and robust to give all the navigation flows that you might need not just tabs. Below are some using links regarding the tabs and another for general navigation using it

https://reactnavigation.org/docs/tab-based-navigation

https://reactnavigation.org/blog/2020/01/29/using-react-navigation-5-with-react-native-paper

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM