diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 30aa2c1ff8..37d6360688 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -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; + focused: boolean; + index: number; + tintColor?: string; +} export interface NavigationTabScreenOptions extends NavigationScreenOptions { tabBarIcon?: React.ReactElement @@ -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 { diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index aca3f1bcf6..40d19f0fee 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -138,6 +138,7 @@ const tabNavigatorScreenOptions: NavigationTabScreenOptions = { tabBarVisible: true, tabBarIcon: , tabBarLabel: 'label', + tabBarOnPress: (scene, index) => {} }; const tabNavigatorConfig: TabNavigatorConfig = {