diff --git a/packages/react-navigation/flow/react-navigation.js b/packages/react-navigation/flow/react-navigation.js index 2b7ebbfa..e47bfea8 100644 --- a/packages/react-navigation/flow/react-navigation.js +++ b/packages/react-navigation/flow/react-navigation.js @@ -945,6 +945,8 @@ declare module 'react-navigation' { itemsContainerStyle?: ViewStyleProp, itemStyle?: ViewStyleProp, labelStyle?: TextStyleProp, + activeLabelStyle?: TextStyleProp, + inactiveLabelStyle?: TextStyleProp, iconContainerStyle?: ViewStyleProp, drawerPosition: 'left' | 'right', }; diff --git a/packages/react-navigation/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap b/packages/react-navigation/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap index 0304d490..efed0e60 100644 --- a/packages/react-navigation/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap +++ b/packages/react-navigation/src/navigators/__tests__/__snapshots__/DrawerNavigator-test.js.snap @@ -224,6 +224,7 @@ exports[`DrawerNavigator renders successfully 1`] = ` "color": "#2196f3", }, undefined, + undefined, ] } > diff --git a/packages/react-navigation/src/views/Drawer/DrawerNavigatorItems.js b/packages/react-navigation/src/views/Drawer/DrawerNavigatorItems.js index 74e652f8..0667c9cd 100644 --- a/packages/react-navigation/src/views/Drawer/DrawerNavigatorItems.js +++ b/packages/react-navigation/src/views/Drawer/DrawerNavigatorItems.js @@ -21,6 +21,8 @@ const DrawerNavigatorItems = ({ itemsContainerStyle, itemStyle, labelStyle, + activeLabelStyle, + inactiveLabelStyle, iconContainerStyle, drawerPosition, }) => ( @@ -34,6 +36,7 @@ const DrawerNavigatorItems = ({ const scene = { route, index, focused, tintColor: color }; const icon = renderIcon(scene); const label = getLabel(scene); + const extraLabelStyle = focused ? activeLabelStyle : inactiveLabelStyle; return ( ) : null} {typeof label === 'string' ? ( - + {label} ) : (