RN project, write a react-navigation component used by DEMO, for nested routing. After setting title in navigationOptions, the title bar of the simulator is blank and no error is reported.
bottom TabNavigator code:
import React from "react";
import {createBottomTabNavigator} from" react-navigation";
import Ionicons from "react-native-vector-icons/Ionicons";
import TestScreen from". / Test";
import SettingScreen from". / SettingScreen";
TestScreen.navigationOptions = {
title: "",
headerStyle: {
backgroundColor: "-sharpf4511e",
},
};
export default createBottomTabNavigator (
{
Home: {
screen: TestScreen,
navigationOptions: ({navigation}) => ({
//tabBarLabel: "",
tabBarIcon: ({tintColor, focused}) => (
<Ionicons
name={focused ? "ios-home" : "ios-home-outline"}
size={26}
style={{ color: tintColor }}
/>
),
}),
},
Setting: {
screen: SettingScreen,
navigationOptions: {
tabBarLabel: "",
tabBarIcon: ({tintColor, focused}) => (
<Ionicons
name={focused ? "ios-add-circle" : "ios-add-circle-outline"}
size={26}
style={{ color: tintColor }}
/>
),
}
}
},{
initialRouteName: "Home"
}
)
StackNavigator Code:
import React from "react";
import {
createBottomTabNavigator,
createStackNavigator,
} from "react-navigation";
import Ionicons from" react-native-vector-icons/Ionicons";
import HomeScreen from". / screen/HomeScreen";
import DetailScreen from". / screen/DetailScreen";
import SettingScreen from". / screen/SettingScreen";
import LoginScreen from".. / screen/LoginScreen";
import TestScreen from. / screen/Test";
import AuthenScreen from". / screen/AuthenScreen";
import IndexStack from". / screen/IndexStack";
export default createStackNavigator ({
Index: IndexStack,
Test: TestScreen,
Home: HomeScreen,
Detail: DetailScreen,
Login: LoginScreen,
Setting: SettingScreen,
Authen: AuthenScreen
}, {
initialRouteName: "Index"
})
Simulator header title bar is blank, setting properties are not rendered