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