How to make drawerContentOptions work in React navigation 6.x

Viewed 932

I don't know how to style my drawer with React navigation 6.x. They say to replace it with 'screenOptions' but it doesn't work. Here is my code:

    <NavigationContainer>
    <Drawer.Navigator
    initialRouteName="Home"
    screenOptions={{
      activeTintColor:"blue",
      itemStyle:{marginTop:20},
      labelStyle:{fontSize:30},
      style:{backgroundColor:'purple'}

    }}>
      <Drawer.Screen name="Home" component={Home}/>
      <Drawer.Screen 
      name="Users" 
      component={Users}
      />
    </Drawer.Navigator>
    </NavigationContainer>

How can i make it work with my styling? I am a beginner, thanks for your help and time.

1 Answers

you can reed here about options here

<Drawer.Navigator
    screenOptions={{
        //options for drawer
        drawerLabel
        drawerIcon
        drawerActiveTintColor
        drawerActiveBackgroundColor
        drawerInactiveTintColor
        drawerInactiveBackgroundColor
        drawerItemStyle
        drawerLabelStyle
        drawerContentContainerStyle
        drawerContentStyle
        drawerStyle
    }}
>
    {/* screens */}
</Drawer.Navigator>
Related