'Styling drawer in react native

here is my drawer SS drawer

i want to change text color and text background when a screen is selected in drawer. I have tried activeTintColor and activeBackgroundColor but they don't work. and i want to change drawer backgroundColor in two different colors. how to do that?



Solution 1:[1]

I presume you are using React Navigation. I recommend you to use a custom component instead. Take a look to related docs:

drawerContent

Solution 2:[2]

For React-Navigation V6:

<MyDrawers.Navigator 
  screenOptions={{ 
    drawerActiveTintColor: "red",
    drawerActiveBackgroundColor: "yellow", 
  }}
>
   <MyDrawers.Screen name="TestingStack" component={TestingStack}/>
</MyDrawers.Navigator>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 yalcinozer
Solution 2 Bilal Abdeen