mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
feat: add tabBarOnPress (#23068)
This commit is contained in:
Vendored
+11
-1
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user