1<Drawer.Navigator initialRouteName="Home" drawerContent={props => {
2 return (
3 <DrawerContentScrollView {...props}>
4 <DrawerItemList {...props} />
5 <DrawerItem label="Logout" onPress={() => props.navigation.navigate("Login")} />
6 </DrawerContentScrollView>
7 )
8 }}>
9 <Drawer.Screen name="Home" component={Home}/>
10 <Drawer.Screen name="New Project" component={NewProject} />
11 </Drawer.Navigator>
12
1I just tried this, but it doesn't seem to work for me:
2
3const HomeScreen = props => {
4 return <Text>Hello World</Text>
5}
6HomeScreen.navigationOptions = screenProps => ({
7 headerTitle: (props) => <Text>Start</Text>,
8})
9
10<NavigationContainer>
11 <Stack.Navigator>
12 <Stack.Screen name="Home" component={HomeScreen} />
13 </Stack.Navigator>
14</NavigationContainer>
15Instead of rendering "Start", it renders "Home". I'm using version 5.10.0
16
17EDIT: Not sure if this is just a hack or not, but it works for me...
18
19<Stack.Screen
20 name="Home"
21 component={HomeScreen}
22 options={HomeScreen.navigationOptions} />