Merge pull request #29981 from JKillian/horizontal_info

add horizontal prop to tabBarIcon option in NavigationTabScreenOptionsBase
This commit is contained in:
Daniel Rosenwasser
2018-10-29 14:24:01 -07:00
committed by GitHub
2 changed files with 5 additions and 3 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for react-navigation 2.0
// Type definitions for react-navigation 2.13
// Project: https://github.com/react-navigation/react-navigation
// Definitions by: Huhuanming <https://github.com/huhuanming>
// mhcgrq <https://github.com/mhcgrq>
@@ -25,6 +25,7 @@
// Denis Frezzato <https://github.com/DenisFrezzato>
// Mickael Wegerich <https://github.com/mickaelw>
// Max Davidson <https://github.com/maxdavidson>
// Jason Killian <https://github.com/jkillian>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -518,7 +519,7 @@ interface NavigationTabScreenOptionsBase {
tabBarIcon?:
| React.ReactElement<any>
| ((
options: { tintColor: string | null; focused: boolean }
options: { tintColor: string | null; focused: boolean; horizontal: boolean }
) => React.ReactElement<any> | null);
tabBarLabel?:
| string
@@ -179,7 +179,8 @@ const tabNavigatorConfig: TabNavigatorConfig = {
tabBarComponent: TabBarTop,
tabBarOptions: { activeBackgroundColor: "blue" },
navigationOptions: () => ({
tabBarOnPress: ({ scene, jumpToIndex }) => jumpToIndex(scene.index)
tabBarOnPress: ({ scene, jumpToIndex }) => jumpToIndex(scene.index),
tabBarIcon: ({ horizontal }) => <View />,
})
};