React native drawer font Color
My code:
return (
<Drawer.Navigator initialRouteName="HomeTabs"
drawerContent={props => {
return (
<DrawerContentScrollView {...props}>
<DrawerItemList {...props} />
<DrawerItem activeTinTcolor = 'red' inactiveTintColor='red' label="Logout" onPress={() => props.navigation.navigate("Login")} />
</DrawerContentScrollView>
)
}}
>
<Drawer.Screen name="HomeTabs" initialParams={{userId: userId, name: name, url: url,fullName: fullName, password: password}} component={HomeTabs} />
<Drawer.Screen name="Authors" component={AuthorsScreen} />
</Drawer.Navigator>
);
}
In DrawerItem I can change the color of the text but when I want to do so in Drawer.Screen none of the options work. I try options, DrowerOptions and and none of them work.
Solution 1:
you can add it in screenOptions like below
<Drawer.Navigator
initialRouteName="HomeTabs"
screenOptions={{
headerShown: false,
drawerActiveTintColor:"red",
drawerInactiveTintColor:"orange"
}}
drawerContent={(props) => <DrawerMenu {...props} />}
>
</Drawer.Navigator>
more options