@react-navigation/bottom-tabs 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/navigators/createBottomTabNavigator.js +2 -0
- package/lib/commonjs/navigators/createBottomTabNavigator.js.map +1 -1
- package/lib/module/navigators/createBottomTabNavigator.js +2 -0
- package/lib/module/navigators/createBottomTabNavigator.js.map +1 -1
- package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts +1 -1
- package/lib/typescript/src/types.d.ts +3 -3
- package/package.json +4 -4
- package/src/navigators/createBottomTabNavigator.tsx +2 -0
- package/src/types.tsx +6 -3
|
@@ -23,6 +23,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
23
23
|
|
|
24
24
|
function BottomTabNavigator(_ref) {
|
|
25
25
|
let {
|
|
26
|
+
id,
|
|
26
27
|
initialRouteName,
|
|
27
28
|
backBehavior,
|
|
28
29
|
children,
|
|
@@ -79,6 +80,7 @@ function BottomTabNavigator(_ref) {
|
|
|
79
80
|
navigation,
|
|
80
81
|
NavigationContent
|
|
81
82
|
} = (0, _native.useNavigationBuilder)(_native.TabRouter, {
|
|
83
|
+
id,
|
|
82
84
|
initialRouteName,
|
|
83
85
|
backBehavior,
|
|
84
86
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["createBottomTabNavigator.tsx"],"names":["BottomTabNavigator","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","JSON","stringify","state","descriptors","navigation","NavigationContent","TabRouter"],"mappings":";;;;;;;AAAA;;AAUA;;AACA;;AAOA;;;;;;;;;;AAWA,SAASA,kBAAT,
|
|
1
|
+
{"version":3,"sources":["createBottomTabNavigator.tsx"],"names":["BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","JSON","stringify","state","descriptors","navigation","NavigationContent","TabRouter"],"mappings":";;;;;;;AAAA;;AAUA;;AACA;;AAOA;;;;;;;;;;AAWA,SAASA,kBAAT,OASU;AAAA,MATkB;AAC1BC,IAAAA,EAD0B;AAE1BC,IAAAA,gBAF0B;AAG1BC,IAAAA,YAH0B;AAI1BC,IAAAA,QAJ0B;AAK1BC,IAAAA,eAL0B;AAM1BC,IAAAA,aAN0B;AAO1BC,IAAAA,mBAP0B;AAQ1B,OAAGC;AARuB,GASlB;AACR,QAAM;AACJ;AACAC,IAAAA,IAFI;AAGJ;AACAC,IAAAA,aAJI;AAKJ,OAAGC;AALC,MAMFH,kBANJ;AAQA,MAAII,oBAAgD,GAAG,EAAvD;;AAEA,MAAIF,aAAJ,EAAmB;AAAA;;AACjBG,IAAAA,MAAM,CAACC,MAAP,CAAcF,oBAAd,EAAoC;AAClCG,MAAAA,oBAAoB,EAAEL,aAAa,CAACM,mBADF;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A,KAAF;AAASC,IAAAA,WAAT;AAAsBC,IAAAA,UAAtB;AAAkCC,IAAAA;AAAlC,MACJ,kCAMEC,iBANF,EAMa;AACXlD,IAAAA,EADW;AAEXC,IAAAA,gBAFW;AAGXC,IAAAA,YAHW;AAIXC,IAAAA,QAJW;AAKXC,IAAAA,eALW;AAMXC,IAAAA,aANW;AAOXM,IAAAA;AAPW,GANb,CADF;AAiBA,sBACE,oBAAC,iBAAD,qBACE,oBAAC,sBAAD,eACMD,IADN;AAEE,IAAA,KAAK,EAAEoC,KAFT;AAGE,IAAA,UAAU,EAAEE,UAHd;AAIE,IAAA,WAAW,EAAED,WAJf;AAKE,IAAA,mBAAmB,EAAEzC;AALvB,KADF,CADF;AAWD;;eAEc,oCAKbP,kBALa,C","sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n ParamListBase,\n TabActionHelpers,\n TabNavigationState,\n TabRouter,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n BottomTabNavigationConfig,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n} from '../types';\nimport BottomTabView from '../views/BottomTabView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabRouterOptions &\n BottomTabNavigationConfig;\n\nfunction BottomTabNavigator({\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n sceneContainerStyle,\n ...restWithDeprecated\n}: Props) {\n const {\n // @ts-expect-error: lazy is deprecated\n lazy,\n // @ts-expect-error: tabBarOptions is deprecated\n tabBarOptions,\n ...rest\n } = restWithDeprecated;\n\n let defaultScreenOptions: BottomTabNavigationOptions = {};\n\n if (tabBarOptions) {\n Object.assign(defaultScreenOptions, {\n tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,\n tabBarActiveTintColor: tabBarOptions.activeTintColor,\n tabBarInactiveTintColor: tabBarOptions.inactiveTintColor,\n tabBarActiveBackgroundColor: tabBarOptions.activeBackgroundColor,\n tabBarInactiveBackgroundColor: tabBarOptions.inactiveBackgroundColor,\n tabBarAllowFontScaling: tabBarOptions.allowFontScaling,\n tabBarShowLabel: tabBarOptions.showLabel,\n tabBarLabelStyle: tabBarOptions.labelStyle,\n tabBarIconStyle: tabBarOptions.iconStyle,\n tabBarItemStyle: tabBarOptions.tabStyle,\n tabBarLabelPosition:\n tabBarOptions.labelPosition ??\n (tabBarOptions.adaptive === false ? 'below-icon' : undefined),\n tabBarStyle: [\n { display: tabBarOptions.tabBarVisible ? 'none' : 'flex' },\n defaultScreenOptions.tabBarStyle,\n ],\n });\n\n (\n Object.keys(defaultScreenOptions) as (keyof BottomTabNavigationOptions)[]\n ).forEach((key) => {\n if (defaultScreenOptions[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete defaultScreenOptions[key];\n }\n });\n\n warnOnce(\n tabBarOptions,\n `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\\n\\nPlace the following in 'screenOptions' in your code to keep current behavior:\\n\\n${JSON.stringify(\n defaultScreenOptions,\n null,\n 2\n )}\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`\n );\n }\n\n if (typeof lazy === 'boolean') {\n defaultScreenOptions.lazy = lazy;\n\n warnOnce(\n true,\n `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`\n );\n }\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n TabActionHelpers<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n >(TabRouter, {\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n return (\n <NavigationContent>\n <BottomTabView\n {...rest}\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n sceneContainerStyle={sceneContainerStyle}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap,\n typeof BottomTabNavigator\n>(BottomTabNavigator);\n"]}
|
|
@@ -7,6 +7,7 @@ import BottomTabView from '../views/BottomTabView';
|
|
|
7
7
|
|
|
8
8
|
function BottomTabNavigator(_ref) {
|
|
9
9
|
let {
|
|
10
|
+
id,
|
|
10
11
|
initialRouteName,
|
|
11
12
|
backBehavior,
|
|
12
13
|
children,
|
|
@@ -63,6 +64,7 @@ function BottomTabNavigator(_ref) {
|
|
|
63
64
|
navigation,
|
|
64
65
|
NavigationContent
|
|
65
66
|
} = useNavigationBuilder(TabRouter, {
|
|
67
|
+
id,
|
|
66
68
|
initialRouteName,
|
|
67
69
|
backBehavior,
|
|
68
70
|
children,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["createBottomTabNavigator.tsx"],"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","React","warnOnce","BottomTabView","BottomTabNavigator","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","JSON","stringify","state","descriptors","navigation","NavigationContent"],"mappings":";;AAAA,SACEA,sBADF,EAMEC,SANF,EAQEC,oBARF,QASO,0BATP;AAUA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,QAAP,MAAqB,WAArB;AAOA,OAAOC,aAAP,MAA0B,wBAA1B;;AAWA,SAASC,kBAAT,
|
|
1
|
+
{"version":3,"sources":["createBottomTabNavigator.tsx"],"names":["createNavigatorFactory","TabRouter","useNavigationBuilder","React","warnOnce","BottomTabView","BottomTabNavigator","id","initialRouteName","backBehavior","children","screenListeners","screenOptions","sceneContainerStyle","restWithDeprecated","lazy","tabBarOptions","rest","defaultScreenOptions","Object","assign","tabBarHideOnKeyboard","keyboardHidesTabBar","tabBarActiveTintColor","activeTintColor","tabBarInactiveTintColor","inactiveTintColor","tabBarActiveBackgroundColor","activeBackgroundColor","tabBarInactiveBackgroundColor","inactiveBackgroundColor","tabBarAllowFontScaling","allowFontScaling","tabBarShowLabel","showLabel","tabBarLabelStyle","labelStyle","tabBarIconStyle","iconStyle","tabBarItemStyle","tabStyle","tabBarLabelPosition","labelPosition","adaptive","undefined","tabBarStyle","display","tabBarVisible","keys","forEach","key","JSON","stringify","state","descriptors","navigation","NavigationContent"],"mappings":";;AAAA,SACEA,sBADF,EAMEC,SANF,EAQEC,oBARF,QASO,0BATP;AAUA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,QAAP,MAAqB,WAArB;AAOA,OAAOC,aAAP,MAA0B,wBAA1B;;AAWA,SAASC,kBAAT,OASU;AAAA,MATkB;AAC1BC,IAAAA,EAD0B;AAE1BC,IAAAA,gBAF0B;AAG1BC,IAAAA,YAH0B;AAI1BC,IAAAA,QAJ0B;AAK1BC,IAAAA,eAL0B;AAM1BC,IAAAA,aAN0B;AAO1BC,IAAAA,mBAP0B;AAQ1B,OAAGC;AARuB,GASlB;AACR,QAAM;AACJ;AACAC,IAAAA,IAFI;AAGJ;AACAC,IAAAA,aAJI;AAKJ,OAAGC;AALC,MAMFH,kBANJ;AAQA,MAAII,oBAAgD,GAAG,EAAvD;;AAEA,M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AAI,OAAOH,IAAP,KAAgB,SAApB,EAA+B;AAC7BG,IAAAA,oBAAoB,CAACH,IAArB,GAA4BA,IAA5B;AAEAX,IAAAA,QAAQ,CACN,IADM,EAEL,+KAFK,CAAR;AAID;;AAED,QAAM;AAAEiD,IAAAA,KAAF;AAASC,IAAAA,WAAT;AAAsBC,IAAAA,UAAtB;AAAkCC,IAAAA;AAAlC,MACJtD,oBAAoB,CAMlBD,SANkB,EAMP;AACXM,IAAAA,EADW;AAEXC,IAAAA,gBAFW;AAGXC,IAAAA,YAHW;AAIXC,IAAAA,QAJW;AAKXC,IAAAA,eALW;AAMXC,IAAAA,aANW;AAOXM,IAAAA;AAPW,GANO,CADtB;AAiBA,sBACE,oBAAC,iBAAD,qBACE,oBAAC,aAAD,eACMD,IADN;AAEE,IAAA,KAAK,EAAEoC,KAFT;AAGE,IAAA,UAAU,EAAEE,UAHd;AAIE,IAAA,WAAW,EAAED,WAJf;AAKE,IAAA,mBAAmB,EAAEzC;AALvB,KADF,CADF;AAWD;;AAED,eAAeb,sBAAsB,CAKnCM,kBALmC,CAArC","sourcesContent":["import {\n createNavigatorFactory,\n DefaultNavigatorOptions,\n ParamListBase,\n TabActionHelpers,\n TabNavigationState,\n TabRouter,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport warnOnce from 'warn-once';\n\nimport type {\n BottomTabNavigationConfig,\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n} from '../types';\nimport BottomTabView from '../views/BottomTabView';\n\ntype Props = DefaultNavigatorOptions<\n ParamListBase,\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n> &\n TabRouterOptions &\n BottomTabNavigationConfig;\n\nfunction BottomTabNavigator({\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n sceneContainerStyle,\n ...restWithDeprecated\n}: Props) {\n const {\n // @ts-expect-error: lazy is deprecated\n lazy,\n // @ts-expect-error: tabBarOptions is deprecated\n tabBarOptions,\n ...rest\n } = restWithDeprecated;\n\n let defaultScreenOptions: BottomTabNavigationOptions = {};\n\n if (tabBarOptions) {\n Object.assign(defaultScreenOptions, {\n tabBarHideOnKeyboard: tabBarOptions.keyboardHidesTabBar,\n tabBarActiveTintColor: tabBarOptions.activeTintColor,\n tabBarInactiveTintColor: tabBarOptions.inactiveTintColor,\n tabBarActiveBackgroundColor: tabBarOptions.activeBackgroundColor,\n tabBarInactiveBackgroundColor: tabBarOptions.inactiveBackgroundColor,\n tabBarAllowFontScaling: tabBarOptions.allowFontScaling,\n tabBarShowLabel: tabBarOptions.showLabel,\n tabBarLabelStyle: tabBarOptions.labelStyle,\n tabBarIconStyle: tabBarOptions.iconStyle,\n tabBarItemStyle: tabBarOptions.tabStyle,\n tabBarLabelPosition:\n tabBarOptions.labelPosition ??\n (tabBarOptions.adaptive === false ? 'below-icon' : undefined),\n tabBarStyle: [\n { display: tabBarOptions.tabBarVisible ? 'none' : 'flex' },\n defaultScreenOptions.tabBarStyle,\n ],\n });\n\n (\n Object.keys(defaultScreenOptions) as (keyof BottomTabNavigationOptions)[]\n ).forEach((key) => {\n if (defaultScreenOptions[key] === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete defaultScreenOptions[key];\n }\n });\n\n warnOnce(\n tabBarOptions,\n `Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\\n\\nPlace the following in 'screenOptions' in your code to keep current behavior:\\n\\n${JSON.stringify(\n defaultScreenOptions,\n null,\n 2\n )}\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`\n );\n }\n\n if (typeof lazy === 'boolean') {\n defaultScreenOptions.lazy = lazy;\n\n warnOnce(\n true,\n `Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\\n\\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details.`\n );\n }\n\n const { state, descriptors, navigation, NavigationContent } =\n useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n TabActionHelpers<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap\n >(TabRouter, {\n id,\n initialRouteName,\n backBehavior,\n children,\n screenListeners,\n screenOptions,\n defaultScreenOptions,\n });\n\n return (\n <NavigationContent>\n <BottomTabView\n {...rest}\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n sceneContainerStyle={sceneContainerStyle}\n />\n </NavigationContent>\n );\n}\n\nexport default createNavigatorFactory<\n TabNavigationState<ParamListBase>,\n BottomTabNavigationOptions,\n BottomTabNavigationEventMap,\n typeof BottomTabNavigator\n>(BottomTabNavigator);\n"]}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { DefaultNavigatorOptions, ParamListBase, TabNavigationState, TabRouterOptions } from '@react-navigation/native';
|
|
3
3
|
import type { BottomTabNavigationConfig, BottomTabNavigationEventMap, BottomTabNavigationOptions } from '../types';
|
|
4
4
|
declare type Props = DefaultNavigatorOptions<ParamListBase, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap> & TabRouterOptions & BottomTabNavigationConfig;
|
|
5
|
-
declare function BottomTabNavigator({ initialRouteName, backBehavior, children, screenListeners, screenOptions, sceneContainerStyle, ...restWithDeprecated }: Props): JSX.Element;
|
|
5
|
+
declare function BottomTabNavigator({ id, initialRouteName, backBehavior, children, screenListeners, screenOptions, sceneContainerStyle, ...restWithDeprecated }: Props): JSX.Element;
|
|
6
6
|
declare const _default: <ParamList extends ParamListBase>() => import("@react-navigation/native").TypedNavigator<ParamList, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap, typeof BottomTabNavigator>;
|
|
7
7
|
export default _default;
|
|
@@ -24,9 +24,9 @@ export declare type BottomTabNavigationEventMap = {
|
|
|
24
24
|
};
|
|
25
25
|
export declare type LabelPosition = 'beside-icon' | 'below-icon';
|
|
26
26
|
export declare type BottomTabNavigationHelpers = NavigationHelpers<ParamListBase, BottomTabNavigationEventMap> & TabActionHelpers<ParamListBase>;
|
|
27
|
-
export declare type BottomTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList> = NavigationProp<ParamList, RouteName, TabNavigationState<ParamList>, BottomTabNavigationOptions, BottomTabNavigationEventMap> & TabActionHelpers<ParamList>;
|
|
28
|
-
export declare type BottomTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList> = {
|
|
29
|
-
navigation: BottomTabNavigationProp<ParamList, RouteName>;
|
|
27
|
+
export declare type BottomTabNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TabNavigationState<ParamList>, BottomTabNavigationOptions, BottomTabNavigationEventMap> & TabActionHelpers<ParamList>;
|
|
28
|
+
export declare type BottomTabScreenProps<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = {
|
|
29
|
+
navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
30
30
|
route: RouteProp<ParamList, RouteName>;
|
|
31
31
|
};
|
|
32
32
|
export declare type TimingKeyboardAnimationConfig = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/bottom-tabs",
|
|
3
3
|
"description": "Bottom tab navigator following iOS design guidelines",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.3.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"clean": "del lib"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-navigation/elements": "^1.3.
|
|
39
|
+
"@react-navigation/elements": "^1.3.2",
|
|
40
40
|
"color": "^3.1.3",
|
|
41
41
|
"warn-once": "^0.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@react-navigation/native": "^6.0.
|
|
44
|
+
"@react-navigation/native": "^6.0.9",
|
|
45
45
|
"@testing-library/react-native": "^7.2.0",
|
|
46
46
|
"@types/color": "^3.0.1",
|
|
47
47
|
"@types/react": "^17.0.9",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
]
|
|
76
76
|
]
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "c5ef6b5e88426e658123ea8590da583314b9001e"
|
|
79
79
|
}
|
|
@@ -28,6 +28,7 @@ type Props = DefaultNavigatorOptions<
|
|
|
28
28
|
BottomTabNavigationConfig;
|
|
29
29
|
|
|
30
30
|
function BottomTabNavigator({
|
|
31
|
+
id,
|
|
31
32
|
initialRouteName,
|
|
32
33
|
backBehavior,
|
|
33
34
|
children,
|
|
@@ -103,6 +104,7 @@ function BottomTabNavigator({
|
|
|
103
104
|
BottomTabNavigationOptions,
|
|
104
105
|
BottomTabNavigationEventMap
|
|
105
106
|
>(TabRouter, {
|
|
107
|
+
id,
|
|
106
108
|
initialRouteName,
|
|
107
109
|
backBehavior,
|
|
108
110
|
children,
|
package/src/types.tsx
CHANGED
|
@@ -42,10 +42,12 @@ export type BottomTabNavigationHelpers = NavigationHelpers<
|
|
|
42
42
|
|
|
43
43
|
export type BottomTabNavigationProp<
|
|
44
44
|
ParamList extends ParamListBase,
|
|
45
|
-
RouteName extends keyof ParamList = keyof ParamList
|
|
45
|
+
RouteName extends keyof ParamList = keyof ParamList,
|
|
46
|
+
NavigatorID extends string | undefined = undefined
|
|
46
47
|
> = NavigationProp<
|
|
47
48
|
ParamList,
|
|
48
49
|
RouteName,
|
|
50
|
+
NavigatorID,
|
|
49
51
|
TabNavigationState<ParamList>,
|
|
50
52
|
BottomTabNavigationOptions,
|
|
51
53
|
BottomTabNavigationEventMap
|
|
@@ -54,9 +56,10 @@ export type BottomTabNavigationProp<
|
|
|
54
56
|
|
|
55
57
|
export type BottomTabScreenProps<
|
|
56
58
|
ParamList extends ParamListBase,
|
|
57
|
-
RouteName extends keyof ParamList = keyof ParamList
|
|
59
|
+
RouteName extends keyof ParamList = keyof ParamList,
|
|
60
|
+
NavigatorID extends string | undefined = undefined
|
|
58
61
|
> = {
|
|
59
|
-
navigation: BottomTabNavigationProp<ParamList, RouteName>;
|
|
62
|
+
navigation: BottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
|
|
60
63
|
route: RouteProp<ParamList, RouteName>;
|
|
61
64
|
};
|
|
62
65
|
|