I'm trying to add bottomTabs to my React Native app but it doesn't show and doesn't throw any errors at me. When I compile it, the "Hello World" text shows up perfectly and the topBar even works as it should, but I just can't get the bottomTabs working.
The Code :
import React from 'react';
import {
Text,
View
} from 'react-native';
import { Navigation } from 'react-native-navigation';
import HomeScreen from './HomeScreen';
const SavedScreen = () => {
return(
<View>
<Text>Hello world!</Text>
</View>
);
}
Navigation.registerComponent('HomeScreen', () => HomeScreen);
Navigation.registerComponent('InfoScreen', () => InfoScreen);
Navigation.events().registerAppLaunchedListener(async () =>{
Navigation.setRoot({
root:{
bottomTabs: {
id: 'BOTTOM_TABS_LAYOUT',
children: [
{
stack: {
id: 'HOME_TAB',
children: [
{
component: {
id: 'HOME_SCREEN',
name: 'HomeScreen'
}
}
],
options: {
bottomTab: {
icon: require('../assets/images/home.png')
}
}
}
},
{
stack: {
id: 'SAVED_TAB',
children: [
{
component: {
id: 'SAVED_SCREEN',
name: 'SavedScreen'
}
}
],
options: {
bottomTab: {
icon: require('../assets/images/home.png')
}
}
}
}
]
}
}
})
})
export default SavedScreen;
I'm using React Native Navigation version 7.11.2