feat: add tabBarOnPress (#23068)

This commit is contained in:
Qibang
2018-01-23 10:36:05 -08:00
committed by Andy
parent 7a3a2f77d5
commit 8abd412a02
2 changed files with 12 additions and 1 deletions
+11 -1
View File
@@ -327,7 +327,12 @@ export interface NavigationTabRouterConfig {
// Does the back button cause the router to switch to the initial tab
backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute`
}
export interface TabScene {
route: NavigationRoute<any>;
focused: boolean;
index: number;
tintColor?: string;
}
export interface NavigationTabScreenOptions extends NavigationScreenOptions {
tabBarIcon?:
React.ReactElement<any>
@@ -341,6 +346,11 @@ export interface NavigationTabScreenOptions extends NavigationScreenOptions {
any
> | string | null));
tabBarVisible?: boolean;
tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string };
tabBarOnPress?: (
scene: TabScene,
jumpToIndex: (index: number) => void
) => void;
}
export interface NavigationDrawerScreenOptions extends NavigationScreenOptions {
@@ -138,6 +138,7 @@ const tabNavigatorScreenOptions: NavigationTabScreenOptions = {
tabBarVisible: true,
tabBarIcon: <View />,
tabBarLabel: 'label',
tabBarOnPress: (scene, index) => {}
};
const tabNavigatorConfig: TabNavigatorConfig = {