@react-navigation/bottom-tabs 7.10.1 → 8.0.0-alpha.1

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.
Files changed (139) hide show
  1. package/lib/module/index.js +3 -2
  2. package/lib/module/index.js.map +1 -1
  3. package/lib/module/navigators/createBottomTabNavigator.js +27 -9
  4. package/lib/module/navigators/createBottomTabNavigator.js.map +1 -1
  5. package/lib/module/utils/BottomTabAnimationContext.js +5 -0
  6. package/lib/module/utils/BottomTabAnimationContext.js.map +1 -0
  7. package/lib/module/utils/useBottomTabAnimation.js +12 -0
  8. package/lib/module/utils/useBottomTabAnimation.js.map +1 -0
  9. package/lib/module/utils/useTabBarPosition.js +34 -0
  10. package/lib/module/utils/useTabBarPosition.js.map +1 -0
  11. package/lib/module/views/BottomTabBar.js +46 -49
  12. package/lib/module/views/BottomTabBar.js.map +1 -1
  13. package/lib/module/views/BottomTabItem.js +17 -15
  14. package/lib/module/views/BottomTabItem.js.map +1 -1
  15. package/lib/module/views/BottomTabViewCommon.js +16 -0
  16. package/lib/module/views/BottomTabViewCommon.js.map +1 -0
  17. package/lib/module/views/{BottomTabView.js → BottomTabViewCustom.js} +107 -106
  18. package/lib/module/views/BottomTabViewCustom.js.map +1 -0
  19. package/lib/module/views/BottomTabViewNative.android.js +4 -0
  20. package/lib/module/views/BottomTabViewNative.android.js.map +1 -0
  21. package/lib/module/views/BottomTabViewNative.ios.js +4 -0
  22. package/lib/module/views/BottomTabViewNative.ios.js.map +1 -0
  23. package/lib/module/views/BottomTabViewNative.js +5 -0
  24. package/lib/module/views/BottomTabViewNative.js.map +1 -0
  25. package/lib/module/{unstable/NativeBottomTabView.native.js → views/BottomTabViewNativeImpl.js} +103 -80
  26. package/lib/module/views/BottomTabViewNativeImpl.js.map +1 -0
  27. package/lib/module/views/ScreenContent.js +39 -0
  28. package/lib/module/views/ScreenContent.js.map +1 -0
  29. package/lib/module/views/TabBarIcon.js +62 -4
  30. package/lib/module/views/TabBarIcon.js.map +1 -1
  31. package/lib/typescript/src/index.d.ts +4 -3
  32. package/lib/typescript/src/index.d.ts.map +1 -1
  33. package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts +10 -6
  34. package/lib/typescript/src/navigators/createBottomTabNavigator.d.ts.map +1 -1
  35. package/lib/typescript/src/types.d.ts +392 -114
  36. package/lib/typescript/src/types.d.ts.map +1 -1
  37. package/lib/typescript/src/utils/BottomTabAnimationContext.d.ts +4 -0
  38. package/lib/typescript/src/utils/BottomTabAnimationContext.d.ts.map +1 -0
  39. package/lib/typescript/src/utils/useBottomTabAnimation.d.ts +2 -0
  40. package/lib/typescript/src/utils/useBottomTabAnimation.d.ts.map +1 -0
  41. package/lib/typescript/src/utils/useTabBarPosition.d.ts +3 -0
  42. package/lib/typescript/src/utils/useTabBarPosition.d.ts.map +1 -0
  43. package/lib/typescript/src/views/BottomTabBar.d.ts +4 -4
  44. package/lib/typescript/src/views/BottomTabBar.d.ts.map +1 -1
  45. package/lib/typescript/src/views/BottomTabItem.d.ts +16 -14
  46. package/lib/typescript/src/views/BottomTabItem.d.ts.map +1 -1
  47. package/lib/typescript/src/views/{BottomTabView.d.ts → BottomTabViewCommon.d.ts} +2 -2
  48. package/lib/typescript/src/views/BottomTabViewCommon.d.ts.map +1 -0
  49. package/lib/typescript/src/views/BottomTabViewCustom.d.ts +10 -0
  50. package/lib/typescript/src/views/BottomTabViewCustom.d.ts.map +1 -0
  51. package/lib/typescript/src/views/BottomTabViewNative.android.d.ts +2 -0
  52. package/lib/typescript/src/views/BottomTabViewNative.android.d.ts.map +1 -0
  53. package/lib/typescript/src/views/BottomTabViewNative.d.ts +3 -0
  54. package/lib/typescript/src/views/BottomTabViewNative.d.ts.map +1 -0
  55. package/lib/typescript/src/views/BottomTabViewNative.ios.d.ts +2 -0
  56. package/lib/typescript/src/views/BottomTabViewNative.ios.d.ts.map +1 -0
  57. package/lib/typescript/src/views/BottomTabViewNativeImpl.d.ts +10 -0
  58. package/lib/typescript/src/views/BottomTabViewNativeImpl.d.ts.map +1 -0
  59. package/lib/typescript/src/views/ScreenContent.d.ts +13 -0
  60. package/lib/typescript/src/views/ScreenContent.d.ts.map +1 -0
  61. package/lib/typescript/src/views/TabBarIcon.d.ts +10 -10
  62. package/lib/typescript/src/views/TabBarIcon.d.ts.map +1 -1
  63. package/package.json +12 -17
  64. package/src/index.tsx +7 -2
  65. package/src/navigators/createBottomTabNavigator.tsx +78 -27
  66. package/src/types.tsx +425 -122
  67. package/src/utils/BottomTabAnimationContext.tsx +7 -0
  68. package/src/utils/useBottomTabAnimation.tsx +15 -0
  69. package/src/utils/useTabBarPosition.tsx +41 -0
  70. package/src/views/BottomTabBar.tsx +68 -67
  71. package/src/views/BottomTabItem.tsx +39 -34
  72. package/src/views/BottomTabViewCommon.tsx +26 -0
  73. package/src/views/{BottomTabView.tsx → BottomTabViewCustom.tsx} +142 -129
  74. package/src/views/BottomTabViewNative.android.tsx +1 -0
  75. package/src/views/BottomTabViewNative.ios.tsx +1 -0
  76. package/src/views/BottomTabViewNative.tsx +3 -0
  77. package/src/{unstable/NativeBottomTabView.native.tsx → views/BottomTabViewNativeImpl.tsx} +161 -120
  78. package/src/views/ScreenContent.tsx +58 -0
  79. package/src/views/TabBarIcon.tsx +79 -11
  80. package/lib/module/unstable/NativeBottomTabView.js +0 -6
  81. package/lib/module/unstable/NativeBottomTabView.js.map +0 -1
  82. package/lib/module/unstable/NativeBottomTabView.native.js.map +0 -1
  83. package/lib/module/unstable/NativeScreen/NativeScreen.js +0 -152
  84. package/lib/module/unstable/NativeScreen/NativeScreen.js.map +0 -1
  85. package/lib/module/unstable/NativeScreen/debounce.js +0 -12
  86. package/lib/module/unstable/NativeScreen/debounce.js.map +0 -1
  87. package/lib/module/unstable/NativeScreen/types.js +0 -4
  88. package/lib/module/unstable/NativeScreen/types.js.map +0 -1
  89. package/lib/module/unstable/NativeScreen/useAnimatedHeaderHeight.js +0 -12
  90. package/lib/module/unstable/NativeScreen/useAnimatedHeaderHeight.js.map +0 -1
  91. package/lib/module/unstable/NativeScreen/useHeaderConfig.js +0 -304
  92. package/lib/module/unstable/NativeScreen/useHeaderConfig.js.map +0 -1
  93. package/lib/module/unstable/createNativeBottomTabNavigator.js +0 -6
  94. package/lib/module/unstable/createNativeBottomTabNavigator.js.map +0 -1
  95. package/lib/module/unstable/createNativeBottomTabNavigator.native.js +0 -65
  96. package/lib/module/unstable/createNativeBottomTabNavigator.native.js.map +0 -1
  97. package/lib/module/unstable/index.js +0 -16
  98. package/lib/module/unstable/index.js.map +0 -1
  99. package/lib/module/unstable/types.js +0 -4
  100. package/lib/module/unstable/types.js.map +0 -1
  101. package/lib/module/views/BottomTabView.js.map +0 -1
  102. package/lib/module/views/ScreenFallback.js +0 -42
  103. package/lib/module/views/ScreenFallback.js.map +0 -1
  104. package/lib/typescript/src/unstable/NativeBottomTabView.d.ts +0 -10
  105. package/lib/typescript/src/unstable/NativeBottomTabView.d.ts.map +0 -1
  106. package/lib/typescript/src/unstable/NativeBottomTabView.native.d.ts +0 -10
  107. package/lib/typescript/src/unstable/NativeBottomTabView.native.d.ts.map +0 -1
  108. package/lib/typescript/src/unstable/NativeScreen/NativeScreen.d.ts +0 -8
  109. package/lib/typescript/src/unstable/NativeScreen/NativeScreen.d.ts.map +0 -1
  110. package/lib/typescript/src/unstable/NativeScreen/debounce.d.ts +0 -2
  111. package/lib/typescript/src/unstable/NativeScreen/debounce.d.ts.map +0 -1
  112. package/lib/typescript/src/unstable/NativeScreen/types.d.ts +0 -523
  113. package/lib/typescript/src/unstable/NativeScreen/types.d.ts.map +0 -1
  114. package/lib/typescript/src/unstable/NativeScreen/useAnimatedHeaderHeight.d.ts +0 -5
  115. package/lib/typescript/src/unstable/NativeScreen/useAnimatedHeaderHeight.d.ts.map +0 -1
  116. package/lib/typescript/src/unstable/NativeScreen/useHeaderConfig.d.ts +0 -11
  117. package/lib/typescript/src/unstable/NativeScreen/useHeaderConfig.d.ts.map +0 -1
  118. package/lib/typescript/src/unstable/createNativeBottomTabNavigator.d.ts +0 -2
  119. package/lib/typescript/src/unstable/createNativeBottomTabNavigator.d.ts.map +0 -1
  120. package/lib/typescript/src/unstable/createNativeBottomTabNavigator.native.d.ts +0 -16
  121. package/lib/typescript/src/unstable/createNativeBottomTabNavigator.native.d.ts.map +0 -1
  122. package/lib/typescript/src/unstable/index.d.ts +0 -13
  123. package/lib/typescript/src/unstable/index.d.ts.map +0 -1
  124. package/lib/typescript/src/unstable/types.d.ts +0 -319
  125. package/lib/typescript/src/unstable/types.d.ts.map +0 -1
  126. package/lib/typescript/src/views/BottomTabView.d.ts.map +0 -1
  127. package/lib/typescript/src/views/ScreenFallback.d.ts +0 -18
  128. package/lib/typescript/src/views/ScreenFallback.d.ts.map +0 -1
  129. package/src/unstable/NativeBottomTabView.tsx +0 -20
  130. package/src/unstable/NativeScreen/NativeScreen.tsx +0 -212
  131. package/src/unstable/NativeScreen/debounce.tsx +0 -14
  132. package/src/unstable/NativeScreen/types.ts +0 -573
  133. package/src/unstable/NativeScreen/useAnimatedHeaderHeight.tsx +0 -18
  134. package/src/unstable/NativeScreen/useHeaderConfig.tsx +0 -434
  135. package/src/unstable/createNativeBottomTabNavigator.native.tsx +0 -116
  136. package/src/unstable/createNativeBottomTabNavigator.tsx +0 -4
  137. package/src/unstable/index.tsx +0 -23
  138. package/src/unstable/types.tsx +0 -403
  139. package/src/views/ScreenFallback.tsx +0 -50
@@ -1,403 +0,0 @@
1
- import type {
2
- DefaultNavigatorOptions,
3
- Descriptor,
4
- NavigationHelpers,
5
- NavigationProp,
6
- ParamListBase,
7
- RouteProp,
8
- TabActionHelpers,
9
- TabNavigationState,
10
- TabRouterOptions,
11
- Theme,
12
- } from '@react-navigation/native';
13
- import type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';
14
- import type { EdgeInsets } from 'react-native-safe-area-context';
15
- import type {
16
- TabBarItemLabelVisibilityMode,
17
- TabsScreenBlurEffect,
18
- TabsSystemItem,
19
- } from 'react-native-screens';
20
- import type { SFSymbol } from 'sf-symbols-typescript';
21
-
22
- import type { NativeHeaderOptions } from './NativeScreen/types';
23
-
24
- export type Layout = { width: number; height: number };
25
-
26
- export type NativeBottomTabNavigationEventMap = {
27
- /**
28
- * Event which fires on tapping on the tab in the tab bar.
29
- */
30
- tabPress: { data: undefined; canPreventDefault: false };
31
- /**
32
- * Event which fires when a transition animation starts.
33
- */
34
- transitionStart: { data: { closing: boolean } };
35
- /**
36
- * Event which fires when a transition animation ends.
37
- */
38
- transitionEnd: { data: { closing: boolean } };
39
- };
40
-
41
- export type NativeBottomTabNavigationProp<
42
- ParamList extends ParamListBase,
43
- RouteName extends keyof ParamList = keyof ParamList,
44
- NavigatorID extends string | undefined = undefined,
45
- > = NavigationProp<
46
- ParamList,
47
- RouteName,
48
- NavigatorID,
49
- TabNavigationState<ParamList>,
50
- NativeBottomTabNavigationOptions,
51
- NativeBottomTabNavigationEventMap
52
- > &
53
- TabActionHelpers<ParamList>;
54
-
55
- export type NativeBottomTabScreenProps<
56
- ParamList extends ParamListBase,
57
- RouteName extends keyof ParamList = keyof ParamList,
58
- NavigatorID extends string | undefined = undefined,
59
- > = {
60
- navigation: NativeBottomTabNavigationProp<ParamList, RouteName, NavigatorID>;
61
- route: RouteProp<ParamList, RouteName>;
62
- };
63
-
64
- export type NativeBottomTabOptionsArgs<
65
- ParamList extends ParamListBase,
66
- RouteName extends keyof ParamList = keyof ParamList,
67
- NavigatorID extends string | undefined = undefined,
68
- > = NativeBottomTabScreenProps<ParamList, RouteName, NavigatorID> & {
69
- theme: Theme;
70
- };
71
-
72
- type IconImage = {
73
- /**
74
- * - `image` - Use a local image as the icon.
75
- */
76
- type: 'image';
77
- /**
78
- * Image source to use as the icon.
79
- * e.g., `require('./path/to/image.png')`
80
- */
81
- source: ImageSourcePropType;
82
- /**
83
- * Whether to apply tint color to the icon.
84
- * Defaults to `true`.
85
- *
86
- * @platform ios
87
- */
88
- tinted?: boolean;
89
- };
90
-
91
- type IconIOSSfSymbol = {
92
- /**
93
- * - `sfSymbol` - Use an SF Symbol as the icon on iOS.
94
- */
95
- type: 'sfSymbol';
96
- /**
97
- * Name of the SF Symbol to use as the icon.
98
- *
99
- * @platform ios
100
- */
101
- name: SFSymbol;
102
- };
103
-
104
- type IconAndroidDrawable = {
105
- /**
106
- * - `drawableResource` - Use a drawable resource as the icon on Android.
107
- */
108
- type: 'drawableResource';
109
- /**
110
- * Name of the drawable resource to use as the icon.
111
- *
112
- * @platform android
113
- */
114
- name: string;
115
- };
116
-
117
- type IconIOS = IconIOSSfSymbol | IconImage;
118
-
119
- type IconAndroid = IconAndroidDrawable | IconImage;
120
-
121
- export type NativeBottomTabIcon = IconIOS | IconAndroid;
122
-
123
- export type NativeBottomTabNavigationOptions = NativeHeaderOptions & {
124
- /**
125
- * Title text for the screen.
126
- */
127
- title?: string;
128
-
129
- /**
130
- * Uses iOS built-in tab bar items with standard iOS styling and localized titles.
131
- * If set to `search`, it's positioned next to the tab bar on iOS 26 and above.
132
- *
133
- * The `tabBarIcon` and `tabBarLabel` options will override the icon and label from the system item.
134
- * If you want to keep the system behavior on iOS, but need to provide icon and label for other platforms,
135
- * Use `Platform.OS` or `Platform.select` to conditionally set `undefined` for `tabBarIcon` and `tabBarLabel` on iOS.
136
- *
137
- * @platform ios
138
- */
139
- tabBarSystemItem?: TabsSystemItem;
140
-
141
- /**
142
- * Title string of the tab displayed in the tab bar
143
- *
144
- * Overrides the label provided by `tabBarSystemItem` on iOS.
145
- *
146
- * If not provided, or set to `undefined`:
147
- * - The system values are used if `tabBarSystemItem` is set on iOS.
148
- * - Otherwise, it falls back to the `title` or route name.
149
- */
150
- tabBarLabel?: string;
151
-
152
- /**
153
- * Label visibility mode for the tab bar items.
154
- *
155
- * The following values are currently supported:
156
- *
157
- * - `auto` - the system decides when to show or hide labels
158
- * - `selected` - labels are shown only for the selected tab
159
- * - `labeled` - labels are always shown
160
- * - `unlabeled` - labels are never shown
161
- *
162
- * Defaults to `auto`.
163
- *
164
- * @platform android
165
- */
166
- tabBarLabelVisibilityMode?: TabBarItemLabelVisibilityMode;
167
-
168
- /**
169
- * Style object for the tab label.
170
- */
171
- tabBarLabelStyle?: Pick<
172
- TextStyle,
173
- 'fontFamily' | 'fontSize' | 'fontWeight' | 'fontStyle'
174
- >;
175
-
176
- /**
177
- * Icon to display for the tab.
178
- *
179
- * Showing a different icon for focused tab is only supported on iOS.
180
- *
181
- * Overrides the icon provided by `tabBarSystemItem` on iOS.
182
- */
183
- tabBarIcon?:
184
- | NativeBottomTabIcon
185
- | ((props: { focused: boolean }) => NativeBottomTabIcon);
186
-
187
- /**
188
- * Text to show in a badge on the tab icon.
189
- */
190
- tabBarBadge?: number | string;
191
-
192
- /**
193
- * Custom style for the tab bar badge.
194
- * You can specify a background color or text color here.
195
- *
196
- * @platform android
197
- */
198
- tabBarBadgeStyle?: {
199
- backgroundColor?: ColorValue;
200
- color?: ColorValue;
201
- };
202
-
203
- /**
204
- * Color for the icon and label in the active tab.
205
- */
206
- tabBarActiveTintColor?: ColorValue;
207
-
208
- /**
209
- * Color for the icon and label in the inactive tabs.
210
- *
211
- * @platform android
212
- */
213
- tabBarInactiveTintColor?: ColorValue;
214
-
215
- /**
216
- * Background color of the active indicator.
217
- *
218
- * @platform android
219
- */
220
- tabBarActiveIndicatorColor?: ColorValue;
221
-
222
- /**
223
- * Specifies if the active indicator should be used. Defaults to `true`.
224
- *
225
- * @platform android
226
- */
227
- tabBarActiveIndicatorEnabled?: boolean;
228
-
229
- /**
230
- * Color of tab bar item's ripple effect.
231
- *
232
- * @platform android
233
- */
234
- tabBarRippleColor?: ColorValue;
235
-
236
- /**
237
- * Style object for the tab bar container.
238
- */
239
- tabBarStyle?: {
240
- /**
241
- * Background color of the tab bar.
242
- *
243
- * Only supported on Android and iOS 18 and below.
244
- */
245
- backgroundColor?: ColorValue;
246
- /**
247
- * Shadow color of the tab bar.
248
- *
249
- * Only supported on iOS 18 and below.
250
- */
251
- shadowColor?: ColorValue;
252
- };
253
-
254
- /**
255
- * Blur effect applied to the tab bar when tab screen is selected.
256
- *
257
- * Works with backgroundColor's alpha < 1.
258
- *
259
- * Only supported on iOS 18 and lower.
260
- *
261
- * The following values are currently supported:
262
- *
263
- * - `none` - disables blur effect
264
- * - `systemDefault` - uses UIKit's default tab bar blur effect
265
- * - one of styles mapped from UIKit's UIBlurEffectStyle, e.g. `systemUltraThinMaterial`
266
- *
267
- * Defaults to `systemDefault`.
268
- *
269
- * Complete list of possible blur effect styles is available in the official UIKit documentation:
270
- * @see {@link https://developer.apple.com/documentation/uikit/uiblureffect/style|UIBlurEffect.Style}
271
- *
272
- * @platform ios
273
- */
274
- tabBarBlurEffect?: TabsScreenBlurEffect;
275
-
276
- /**
277
- * Display mode for the tab bar.
278
- *
279
- * Available starting from iOS 18.
280
- * Not supported on tvOS.
281
- *
282
- * The following values are currently supported:
283
- *
284
- * - `auto` - the system sets the display mode based on the tab’s content
285
- * - `tabBar` - the system displays the content only as a tab bar
286
- * - `tabSidebar` - the tab bar is displayed as a sidebar
287
- *
288
- * Defaults to `auto`.
289
- *
290
- * @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/mode|UITabBarController.Mode}
291
- *
292
- * @platform ios
293
- */
294
- tabBarControllerMode?: 'auto' | 'tabBar' | 'tabSidebar';
295
-
296
- /**
297
- * Minimize behavior for the tab bar.
298
- *
299
- * Available starting from iOS 26.
300
- *
301
- * The following values are currently supported:
302
- *
303
- * - `auto` - resolves to the system default minimize behavior
304
- * - `never` - the tab bar does not minimize
305
- * - `onScrollDown` - the tab bar minimizes when scrolling down and
306
- * expands when scrolling back up
307
- * - `onScrollUp` - the tab bar minimizes when scrolling up and expands
308
- * when scrolling back down
309
- *
310
- * Defaults to `auto`.
311
- *
312
- * The supported values correspond to the official UIKit documentation:
313
- * @see {@link https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior|UITabBarController.MinimizeBehavior}
314
- *
315
- * @platform ios
316
- */
317
- tabBarMinimizeBehavior?: 'auto' | 'never' | 'onScrollDown' | 'onScrollUp';
318
-
319
- /**
320
- * Function which returns a React element to display as an accessory view.
321
- *
322
- * Accepts a `placement` parameter which can be one of the following values:
323
- * - `regular` - at bottom of the screen, above the tab bar if tab bar is at the bottom
324
- * - `inline` - inline with the collapsed bottom tab bar (e.g. when minimized based on `tabBarMinimizeBehavior`)
325
- *
326
- * Note: the content is rendered twice for both placements, but only one is visible at a time based on the tab bar state.
327
- * Any shared state should be stored outside of the component to keep both versions in sync.
328
- *
329
- * Available starting from iOS 26.
330
- *
331
- * @platform ios
332
- */
333
- bottomAccessory?: (options: {
334
- placement: 'regular' | 'inline';
335
- }) => React.ReactNode;
336
-
337
- /**
338
- * Whether this screens should render the first time it's accessed. Defaults to `true`.
339
- * Set it to `false` if you want to render the screen on initial render.
340
- */
341
- lazy?: boolean;
342
-
343
- /**
344
- * Whether any nested stack should be popped to top when navigating away from the tab.
345
- * Defaults to `false`.
346
- */
347
- popToTopOnBlur?: boolean;
348
- };
349
-
350
- export type NativeBottomTabDescriptor = Descriptor<
351
- NativeBottomTabNavigationOptions,
352
- NativeBottomTabNavigationProp<ParamListBase>,
353
- RouteProp<ParamListBase>
354
- >;
355
-
356
- export type NativeBottomTabDescriptorMap = Record<
357
- string,
358
- NativeBottomTabDescriptor
359
- >;
360
-
361
- export type NativeBottomTabNavigationConfig = {};
362
-
363
- export type NativeBottomTabBarProps = {
364
- state: TabNavigationState<ParamListBase>;
365
- descriptors: NativeBottomTabDescriptorMap;
366
- navigation: NavigationHelpers<
367
- ParamListBase,
368
- NativeBottomTabNavigationEventMap
369
- >;
370
- insets: EdgeInsets;
371
- };
372
-
373
- export type NativeBottomTabNavigatorProps = DefaultNavigatorOptions<
374
- ParamListBase,
375
- string | undefined,
376
- TabNavigationState<ParamListBase>,
377
- NativeBottomTabNavigationOptions,
378
- NativeBottomTabNavigationEventMap,
379
- NativeBottomTabNavigationProp<ParamListBase>
380
- > &
381
- TabRouterOptions &
382
- NativeBottomTabNavigationConfig;
383
-
384
- export type NativeBottomTabNavigationHelpers = NavigationHelpers<
385
- ParamListBase,
386
- NativeBottomTabNavigationEventMap
387
- > &
388
- TabActionHelpers<ParamListBase>;
389
-
390
- export type NativeBottomTabHeaderProps = {
391
- /**
392
- * Options for the current screen.
393
- */
394
- options: NativeBottomTabNavigationOptions;
395
- /**
396
- * Route object for the current screen.
397
- */
398
- route: RouteProp<ParamListBase>;
399
- /**
400
- * Navigation prop for the header.
401
- */
402
- navigation: NativeBottomTabNavigationProp<ParamListBase>;
403
- };
@@ -1,50 +0,0 @@
1
- import * as React from 'react';
2
- import {
3
- Animated,
4
- type StyleProp,
5
- View,
6
- type ViewProps,
7
- type ViewStyle,
8
- } from 'react-native';
9
-
10
- type Props = {
11
- enabled: boolean;
12
- active: 0 | 1 | 2 | Animated.AnimatedInterpolation<0 | 1>;
13
- children: React.ReactNode;
14
- freezeOnBlur?: boolean;
15
- shouldFreeze: boolean;
16
- style?: StyleProp<ViewStyle>;
17
- };
18
-
19
- let Screens: typeof import('react-native-screens') | undefined;
20
-
21
- try {
22
- Screens = require('react-native-screens');
23
- } catch (e) {
24
- // Ignore
25
- }
26
-
27
- export const MaybeScreenContainer = ({
28
- enabled,
29
- ...rest
30
- }: ViewProps & {
31
- enabled: boolean;
32
- hasTwoStates: boolean;
33
- children: React.ReactNode;
34
- }) => {
35
- if (Screens?.screensEnabled?.()) {
36
- return <Screens.ScreenContainer enabled={enabled} {...rest} />;
37
- }
38
-
39
- return <View {...rest} />;
40
- };
41
-
42
- export function MaybeScreen({ enabled, active, ...rest }: ViewProps & Props) {
43
- if (Screens?.screensEnabled?.()) {
44
- return (
45
- <Screens.Screen enabled={enabled} activityState={active} {...rest} />
46
- );
47
- }
48
-
49
- return <View {...rest} />;
50
- }