@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,9 +1,9 @@
1
+ import { getLabel } from '@react-navigation/elements';
1
2
  import {
2
- getLabel,
3
+ Color,
3
4
  Lazy,
4
5
  SafeAreaProviderCompat,
5
- Screen as ScreenContent,
6
- } from '@react-navigation/elements';
6
+ } from '@react-navigation/elements/internal';
7
7
  import {
8
8
  CommonActions,
9
9
  NavigationMetaContext,
@@ -13,36 +13,46 @@ import {
13
13
  type TabNavigationState,
14
14
  useTheme,
15
15
  } from '@react-navigation/native';
16
- import Color from 'color';
17
16
  import * as React from 'react';
18
- import { type ColorValue, Platform, PlatformColor } from 'react-native';
17
+ import { Animated, Platform, PlatformColor } from 'react-native';
19
18
  import {
20
19
  type PlatformIcon,
21
20
  Tabs,
22
21
  type TabsScreenItemStateAppearance,
23
22
  } from 'react-native-screens';
24
23
 
25
- import { NativeScreen } from './NativeScreen/NativeScreen';
26
24
  import type {
27
- NativeBottomTabDescriptorMap,
28
- NativeBottomTabIcon,
29
- NativeBottomTabNavigationConfig,
30
- NativeBottomTabNavigationHelpers,
31
- NativeBottomTabNavigationOptions,
32
- NativeBottomTabNavigationProp,
33
- } from './types';
34
-
35
- type Props = NativeBottomTabNavigationConfig & {
25
+ BottomTabDescriptorMap,
26
+ BottomTabIcon,
27
+ BottomTabNavigationConfig,
28
+ BottomTabNavigationHelpers,
29
+ } from '../types';
30
+ import { BottomTabAnimationContext } from '../utils/BottomTabAnimationContext';
31
+ import { BottomTabBarHeightContext } from '../utils/BottomTabBarHeightContext';
32
+ import { useTabBarPosition } from '../utils/useTabBarPosition';
33
+ import { ScreenContent } from './ScreenContent';
34
+
35
+ type Props = BottomTabNavigationConfig & {
36
36
  state: TabNavigationState<ParamListBase>;
37
- navigation: NativeBottomTabNavigationHelpers;
38
- descriptors: NativeBottomTabDescriptorMap;
37
+ navigation: BottomTabNavigationHelpers;
38
+ descriptors: BottomTabDescriptorMap;
39
39
  };
40
40
 
41
+ const ICON_SIZE = Platform.select({
42
+ ios: 25,
43
+ default: 24,
44
+ });
45
+
41
46
  const meta = {
42
47
  type: 'native-tabs',
43
48
  };
44
49
 
45
- export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
50
+ export function BottomTabViewNative({
51
+ state,
52
+ navigation,
53
+ descriptors,
54
+ tabBar,
55
+ }: Props) {
46
56
  const { dark, colors, fonts } = useTheme();
47
57
 
48
58
  const focusedRouteKey = state.routes[state.index].key;
@@ -91,45 +101,37 @@ export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
91
101
 
92
102
  const inactiveTintColor =
93
103
  currentOptions.tabBarInactiveTintColor ??
94
- Platform.select<ColorValue | string>({
95
- ios: PlatformColor('label'),
96
- default: colors.text,
97
- });
104
+ Platform.select({ ios: PlatformColor('label'), default: colors.text });
98
105
 
99
106
  const activeIndicatorColor =
100
- (currentOptions?.tabBarActiveIndicatorColor ??
101
- typeof activeTintColor === 'string')
102
- ? Color(activeTintColor)?.alpha(0.1).string()
103
- : undefined;
104
-
105
- const onTransitionStart = ({
106
- closing,
107
- route,
108
- }: {
109
- closing: boolean;
110
- route: Route<string>;
111
- }) => {
107
+ currentOptions?.tabBarActiveIndicatorColor ??
108
+ Color(activeTintColor)?.alpha(0.1).string();
109
+
110
+ const onTransitionStart = ({ route }: { route: Route<string> }) => {
112
111
  navigation.emit({
113
112
  type: 'transitionStart',
114
- data: { closing },
115
113
  target: route.key,
116
114
  });
117
115
  };
118
116
 
119
- const onTransitionEnd = ({
120
- closing,
121
- route,
122
- }: {
123
- closing: boolean;
124
- route: Route<string>;
125
- }) => {
117
+ const onTransitionEnd = ({ route }: { route: Route<string> }) => {
126
118
  navigation.emit({
127
119
  type: 'transitionEnd',
128
- data: { closing },
129
120
  target: route.key,
130
121
  });
131
122
  };
132
123
 
124
+ const tabBarPosition = useTabBarPosition(currentOptions);
125
+
126
+ const hasCustomTabBar = tabBar != null;
127
+ const tabBarElement = tabBar
128
+ ? tabBar({
129
+ state,
130
+ descriptors,
131
+ navigation,
132
+ })
133
+ : null;
134
+
133
135
  const tabBarControllerMode =
134
136
  currentOptions.tabBarControllerMode === 'auto'
135
137
  ? 'automatic'
@@ -138,13 +140,26 @@ export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
138
140
  const tabBarMinimizeBehavior =
139
141
  currentOptions.tabBarMinimizeBehavior === 'auto'
140
142
  ? 'automatic'
141
- : currentOptions.tabBarMinimizeBehavior;
143
+ : currentOptions.tabBarMinimizeBehavior === 'none'
144
+ ? 'never'
145
+ : currentOptions.tabBarMinimizeBehavior;
142
146
 
143
147
  const bottomAccessory = currentOptions.bottomAccessory;
144
148
 
145
149
  return (
146
- <SafeAreaProviderCompat>
150
+ <SafeAreaProviderCompat
151
+ style={{
152
+ flexDirection:
153
+ tabBarPosition === 'left' || tabBarPosition === 'right'
154
+ ? 'row'
155
+ : 'column',
156
+ }}
157
+ >
158
+ {tabBarPosition === 'top' || tabBarPosition === 'left'
159
+ ? tabBarElement
160
+ : null}
147
161
  <Tabs.Host
162
+ tabBarHidden={hasCustomTabBar}
148
163
  bottomAccessory={
149
164
  bottomAccessory
150
165
  ? (environment) => bottomAccessory({ placement: environment })
@@ -180,11 +195,18 @@ export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
180
195
  );
181
196
 
182
197
  if (route) {
183
- navigation.emit({
198
+ const event = navigation.emit({
184
199
  type: 'tabPress',
185
200
  target: route.key,
201
+ canPreventDefault: true,
186
202
  });
187
203
 
204
+ if (event.defaultPrevented) {
205
+ throw new Error(
206
+ "Preventing default for 'tabPress' is not supported with native tab bar."
207
+ );
208
+ }
209
+
188
210
  const isFocused =
189
211
  state.index ===
190
212
  state.routes.findIndex((r) => r.key === route.key);
@@ -213,6 +235,8 @@ export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
213
235
  tabBarSystemItem,
214
236
  tabBarBlurEffect = dark ? 'systemMaterialDark' : 'systemMaterial',
215
237
  tabBarStyle,
238
+ sceneStyle,
239
+ scrollEdgeEffects,
216
240
  } = options;
217
241
 
218
242
  const {
@@ -238,32 +262,45 @@ export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
238
262
  tabBarBadgeStyle?.backgroundColor ?? colors.notification;
239
263
  const badgeTextColor =
240
264
  tabBarBadgeStyle?.color ??
241
- (typeof badgeBackgroundColor === 'string'
242
- ? Color(badgeBackgroundColor).isLight()
243
- ? 'black'
244
- : 'white'
245
- : undefined);
246
-
247
- const icon =
248
- typeof tabBarIcon === 'function'
249
- ? getPlatformIcon(tabBarIcon({ focused: false }))
250
- : tabBarIcon != null
251
- ? getPlatformIcon(tabBarIcon)
252
- : undefined;
253
-
254
- const selectedIcon =
255
- typeof tabBarIcon === 'function'
256
- ? getPlatformIcon(tabBarIcon({ focused: true }))
257
- : undefined;
265
+ (Color(badgeBackgroundColor)?.isLight() ? 'black' : 'white');
266
+
267
+ const getIcon = (selected: boolean) => {
268
+ if (typeof tabBarIcon === 'function') {
269
+ const result = tabBarIcon({
270
+ focused: selected,
271
+ size: ICON_SIZE!,
272
+ color: selected ? activeTintColor : inactiveTintColor,
273
+ });
274
+
275
+ if (React.isValidElement(result)) {
276
+ throw new Error(
277
+ `Returning a React element from 'tabBarIcon' is not supported with native tab bar.`
278
+ );
279
+ } else if (
280
+ result &&
281
+ typeof result === 'object' &&
282
+ 'type' in result
283
+ ) {
284
+ return getPlatformIcon(result);
285
+ } else {
286
+ throw new Error(
287
+ `The 'tabBarIcon' function must return an icon object (got ${typeof result}).`
288
+ );
289
+ }
290
+ } else if (tabBarIcon != null) {
291
+ return getPlatformIcon(tabBarIcon);
292
+ }
293
+
294
+ return undefined;
295
+ };
296
+
297
+ const icon = getIcon(false);
298
+ const selectedIcon = getIcon(true);
258
299
 
259
300
  return (
260
301
  <Tabs.Screen
261
- onWillDisappear={() =>
262
- onTransitionStart({ closing: true, route })
263
- }
264
- onWillAppear={() => onTransitionStart({ closing: false, route })}
265
- onDidAppear={() => onTransitionEnd({ closing: false, route })}
266
- onDidDisappear={() => onTransitionEnd({ closing: true, route })}
302
+ onWillAppear={() => onTransitionStart({ route })}
303
+ onDidAppear={() => onTransitionEnd({ route })}
267
304
  key={route.key}
268
305
  tabKey={route.key}
269
306
  icon={icon}
@@ -274,6 +311,27 @@ export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
274
311
  systemItem={tabBarSystemItem}
275
312
  isFocused={isFocused}
276
313
  title={tabTitle}
314
+ scrollEdgeEffects={{
315
+ top:
316
+ scrollEdgeEffects?.top === 'auto'
317
+ ? 'automatic'
318
+ : scrollEdgeEffects?.top,
319
+ bottom:
320
+ scrollEdgeEffects?.bottom === 'auto'
321
+ ? 'automatic'
322
+ : scrollEdgeEffects?.bottom,
323
+ left:
324
+ scrollEdgeEffects?.left === 'auto'
325
+ ? 'automatic'
326
+ : scrollEdgeEffects?.left,
327
+ right:
328
+ scrollEdgeEffects?.right === 'auto'
329
+ ? 'automatic'
330
+ : scrollEdgeEffects?.right,
331
+ }}
332
+ // FIXME: if this is not provided, ScrollView on lazy tabs glitches on iOS 18
333
+ // For now we provide an empty object before adding proper support
334
+ scrollEdgeAppearance={{}}
277
335
  standardAppearance={{
278
336
  tabBarBackgroundColor,
279
337
  tabBarShadowColor,
@@ -297,83 +355,66 @@ export function NativeBottomTabView({ state, navigation, descriptors }: Props) {
297
355
  experimental_userInterfaceStyle={dark ? 'dark' : 'light'}
298
356
  >
299
357
  <Lazy enabled={lazy} visible={isFocused || isPreloaded}>
300
- <ScreenWithHeader
358
+ <ScreenContent
301
359
  isFocused={isFocused}
302
360
  route={route}
303
361
  navigation={navigation}
304
362
  options={options}
363
+ style={sceneStyle}
305
364
  >
306
- <NavigationMetaContext.Provider value={meta}>
307
- {render()}
308
- </NavigationMetaContext.Provider>
309
- </ScreenWithHeader>
365
+ <AnimatedScreenContent isFocused={isFocused}>
366
+ <BottomTabBarHeightContext.Provider value={0}>
367
+ <NavigationMetaContext.Provider value={meta}>
368
+ {render()}
369
+ </NavigationMetaContext.Provider>
370
+ </BottomTabBarHeightContext.Provider>
371
+ </AnimatedScreenContent>
372
+ </ScreenContent>
310
373
  </Lazy>
311
374
  </Tabs.Screen>
312
375
  );
313
376
  })}
314
377
  </Tabs.Host>
378
+ {tabBarPosition === 'bottom' || tabBarPosition === 'right'
379
+ ? tabBarElement
380
+ : null}
315
381
  </SafeAreaProviderCompat>
316
382
  );
317
383
  }
318
-
319
- function ScreenWithHeader({
384
+ function AnimatedScreenContent({
320
385
  isFocused,
321
- route,
322
- navigation,
323
- options,
324
386
  children,
325
387
  }: {
326
388
  isFocused: boolean;
327
- route: Route<string>;
328
- navigation: NativeBottomTabNavigationProp<ParamListBase>;
329
- options: NativeBottomTabNavigationOptions;
330
389
  children: React.ReactNode;
331
390
  }) {
332
- const {
333
- headerTransparent,
334
- header: renderCustomHeader,
335
- headerShown = renderCustomHeader != null,
336
- } = options;
337
-
338
- const hasNativeHeader = headerShown && renderCustomHeader == null;
339
-
340
- const [wasNativeHeaderShown] = React.useState(hasNativeHeader);
341
-
342
- React.useEffect(() => {
343
- if (wasNativeHeaderShown !== hasNativeHeader) {
344
- throw new Error(
345
- `Changing 'headerShown' or 'header' options dynamically is not supported when using native header.`
346
- );
347
- }
348
- }, [wasNativeHeaderShown, hasNativeHeader]);
391
+ const [progress] = React.useState(
392
+ () => new Animated.Value(isFocused ? 1 : 0)
393
+ );
349
394
 
350
- if (hasNativeHeader) {
351
- return (
352
- <NativeScreen route={route} navigation={navigation} options={options}>
353
- {children}
354
- </NativeScreen>
355
- );
356
- }
395
+ React.useLayoutEffect(() => {
396
+ /**
397
+ * We don't have animation progress from native,
398
+ * So we expose a static value (0 or 1) based on focus state.
399
+ * Otherwise code using the `useTabAnimation` hook will crash
400
+ */
401
+ progress.setValue(isFocused ? 1 : 0);
402
+ }, [isFocused, progress]);
403
+
404
+ const interpolationProps = React.useMemo(() => {
405
+ return {
406
+ current: { progress },
407
+ };
408
+ }, [progress]);
357
409
 
358
410
  return (
359
- <ScreenContent
360
- focused={isFocused}
361
- route={route}
362
- navigation={navigation}
363
- headerShown={headerShown}
364
- headerTransparent={headerTransparent}
365
- header={renderCustomHeader?.({
366
- route,
367
- navigation,
368
- options,
369
- })}
370
- >
411
+ <BottomTabAnimationContext.Provider value={interpolationProps}>
371
412
  {children}
372
- </ScreenContent>
413
+ </BottomTabAnimationContext.Provider>
373
414
  );
374
415
  }
375
416
 
376
- function getPlatformIcon(icon: NativeBottomTabIcon): PlatformIcon {
417
+ function getPlatformIcon(icon: BottomTabIcon): PlatformIcon {
377
418
  return {
378
419
  ios:
379
420
  icon?.type === 'sfSymbol'
@@ -0,0 +1,58 @@
1
+ import { getHeaderTitle, Header } from '@react-navigation/elements';
2
+ import { Screen } from '@react-navigation/elements/internal';
3
+ import type { ParamListBase, Route } from '@react-navigation/native';
4
+ import * as React from 'react';
5
+ import { type StyleProp, type ViewStyle } from 'react-native';
6
+
7
+ import type {
8
+ BottomTabNavigationOptions,
9
+ BottomTabNavigationProp,
10
+ } from '../types';
11
+
12
+ export function ScreenContent({
13
+ isFocused,
14
+ route,
15
+ navigation,
16
+ options,
17
+ style,
18
+ children,
19
+ }: {
20
+ isFocused: boolean;
21
+ route: Route<string>;
22
+ navigation: BottomTabNavigationProp<ParamListBase>;
23
+ options: BottomTabNavigationOptions;
24
+ style?: StyleProp<ViewStyle>;
25
+ children: React.ReactNode;
26
+ }) {
27
+ const {
28
+ headerTransparent,
29
+ header: renderCustomHeader,
30
+ headerShown = renderCustomHeader != null,
31
+ } = options;
32
+
33
+ const hasDefaultHeader = headerShown && renderCustomHeader == null;
34
+
35
+ return (
36
+ <Screen
37
+ focused={isFocused}
38
+ route={route}
39
+ navigation={navigation}
40
+ headerShown={headerShown}
41
+ headerTransparent={headerTransparent}
42
+ header={
43
+ hasDefaultHeader ? (
44
+ <Header {...options} title={getHeaderTitle(options, route.name)} />
45
+ ) : (
46
+ renderCustomHeader?.({
47
+ route,
48
+ navigation,
49
+ options,
50
+ })
51
+ )
52
+ }
53
+ style={style}
54
+ >
55
+ {children}
56
+ </Screen>
57
+ );
58
+ }
@@ -1,7 +1,10 @@
1
1
  import { Badge } from '@react-navigation/elements';
2
- import type { Route } from '@react-navigation/native';
2
+ import { MissingIcon } from '@react-navigation/elements/internal';
3
+ import { type Route, SFSymbol } from '@react-navigation/native';
3
4
  import React from 'react';
4
5
  import {
6
+ type ColorValue,
7
+ Image,
5
8
  type StyleProp,
6
9
  StyleSheet,
7
10
  type TextStyle,
@@ -9,7 +12,9 @@ import {
9
12
  type ViewStyle,
10
13
  } from 'react-native';
11
14
 
12
- type Props = {
15
+ import type { BottomTabIcon } from '../types';
16
+
17
+ export type TabBarIconProps = {
13
18
  route: Route<string>;
14
19
  variant: 'uikit' | 'material';
15
20
  size: 'compact' | 'regular';
@@ -17,13 +22,15 @@ type Props = {
17
22
  badgeStyle?: StyleProp<TextStyle>;
18
23
  activeOpacity: number;
19
24
  inactiveOpacity: number;
20
- activeTintColor: string;
21
- inactiveTintColor: string;
22
- renderIcon: (props: {
23
- focused: boolean;
24
- color: string;
25
- size: number;
26
- }) => React.ReactNode;
25
+ activeTintColor: ColorValue;
26
+ inactiveTintColor: ColorValue;
27
+ icon:
28
+ | BottomTabIcon
29
+ | ((props: {
30
+ focused: boolean;
31
+ color: ColorValue;
32
+ size: number;
33
+ }) => BottomTabIcon | React.ReactNode);
27
34
  allowFontScaling?: boolean;
28
35
  style: StyleProp<ViewStyle>;
29
36
  };
@@ -50,10 +57,10 @@ export function TabBarIcon({
50
57
  inactiveOpacity,
51
58
  activeTintColor,
52
59
  inactiveTintColor,
53
- renderIcon,
60
+ icon,
54
61
  allowFontScaling,
55
62
  style,
56
- }: Props) {
63
+ }: TabBarIconProps) {
57
64
  const iconSize =
58
65
  variant === 'material'
59
66
  ? ICON_SIZE_MATERIAL
@@ -88,6 +95,7 @@ export function TabBarIcon({
88
95
  focused: true,
89
96
  size: iconSize,
90
97
  color: activeTintColor,
98
+ icon,
91
99
  })}
92
100
  </View>
93
101
  <View style={[styles.icon, { opacity: inactiveOpacity }]}>
@@ -95,6 +103,7 @@ export function TabBarIcon({
95
103
  focused: false,
96
104
  size: iconSize,
97
105
  color: inactiveTintColor,
106
+ icon,
98
107
  })}
99
108
  </View>
100
109
  <Badge
@@ -109,6 +118,65 @@ export function TabBarIcon({
109
118
  );
110
119
  }
111
120
 
121
+ function renderIcon({
122
+ focused,
123
+ size,
124
+ color,
125
+ icon,
126
+ }: {
127
+ focused: boolean;
128
+ size: number;
129
+ color: ColorValue;
130
+ icon: TabBarIconProps['icon'];
131
+ }) {
132
+ const iconValue =
133
+ typeof icon === 'function' ? icon({ focused, size, color }) : icon;
134
+
135
+ if (React.isValidElement(iconValue)) {
136
+ return iconValue;
137
+ }
138
+
139
+ if (
140
+ typeof iconValue === 'object' &&
141
+ iconValue != null &&
142
+ 'type' in iconValue
143
+ ) {
144
+ switch (iconValue.type) {
145
+ case 'image':
146
+ return (
147
+ <Image
148
+ source={iconValue.source}
149
+ style={{
150
+ width: size,
151
+ height: size,
152
+ tintColor: iconValue.tinted === false ? undefined : color,
153
+ }}
154
+ />
155
+ );
156
+ case 'drawableResource':
157
+ return (
158
+ <Image
159
+ source={{ uri: iconValue.name }}
160
+ style={{
161
+ width: size,
162
+ height: size,
163
+ tintColor: iconValue.tinted === false ? undefined : color,
164
+ }}
165
+ />
166
+ );
167
+ case 'sfSymbol':
168
+ return <SFSymbol name={iconValue.name} size={size} color={color} />;
169
+ default: {
170
+ const _exhaustiveCheck: never = iconValue;
171
+
172
+ return _exhaustiveCheck;
173
+ }
174
+ }
175
+ }
176
+
177
+ return <MissingIcon color={color} size={size} />;
178
+ }
179
+
112
180
  const styles = StyleSheet.create({
113
181
  icon: {
114
182
  // We render the icon twice at the same position on top of each other:
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- export function NativeBottomTabView(_) {
4
- throw new Error('Native Bottom Tabs are not supported on this platform.');
5
- }
6
- //# sourceMappingURL=NativeBottomTabView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NativeBottomTabView","_","Error"],"sourceRoot":"../../../src","sources":["unstable/NativeBottomTabView.tsx"],"mappings":";;AAiBA,OAAO,SAASA,mBAAmBA,CAACC,CAAQ,EAAE;EAC5C,MAAM,IAAIC,KAAK,CAAC,wDAAwD,CAAC;AAC3E","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["getLabel","Lazy","SafeAreaProviderCompat","Screen","ScreenContent","CommonActions","NavigationMetaContext","StackActions","useTheme","Color","React","Platform","PlatformColor","Tabs","NativeScreen","jsx","_jsx","meta","type","NativeBottomTabView","state","navigation","descriptors","dark","colors","fonts","focusedRouteKey","routes","index","key","previousRouteKeyRef","useRef","useEffect","previousRouteKey","current","options","popToTopOnBlur","prevRoute","find","route","popToTopAction","popToTop","target","dispatch","currentOptions","fontFamily","select","ios","medium","default","regular","fontWeight","fontSize","fontStyle","tabBarLabelStyle","activeTintColor","tabBarActiveTintColor","primary","inactiveTintColor","tabBarInactiveTintColor","text","activeIndicatorColor","tabBarActiveIndicatorColor","alpha","string","undefined","onTransitionStart","closing","emit","data","onTransitionEnd","tabBarControllerMode","tabBarMinimizeBehavior","bottomAccessory","children","Host","environment","placement","tabBarItemLabelVisibilityMode","tabBarLabelVisibilityMode","tabBarTintColor","tabBarItemIconColor","tabBarItemIconColorActive","tabBarItemTitleFontColor","tabBarItemTitleFontColorActive","tabBarItemTitleFontFamily","tabBarItemTitleFontWeight","tabBarItemTitleFontSize","tabBarItemTitleFontSizeActive","tabBarItemTitleFontStyle","tabBarBackgroundColor","tabBarStyle","backgroundColor","card","tabBarItemActiveIndicatorColor","tabBarItemActiveIndicatorEnabled","tabBarActiveIndicatorEnabled","tabBarItemRippleColor","tabBarRippleColor","experimentalControlNavigationStateInJS","onNativeFocusChange","e","nativeEvent","tabKey","isFocused","findIndex","r","navigate","name","params","map","render","isPreloaded","preloadedRouteKeys","includes","title","lazy","tabBarLabel","tabBarBadgeStyle","tabBarIcon","tabBarBadge","tabBarSystemItem","tabBarBlurEffect","shadowColor","tabBarShadowColor","tabTitle","OS","label","tabItemAppearance","badgeBackgroundColor","notification","badgeTextColor","color","isLight","icon","getPlatformIcon","focused","selectedIcon","onWillDisappear","onWillAppear","onDidAppear","onDidDisappear","shared","tabBarItemBadgeBackgroundColor","tabBarItemBadgeTextColor","badgeValue","toString","systemItem","standardAppearance","stacked","normal","inline","compactInline","specialEffects","repeatedTabSelection","popToRoot","scrollToTop","experimental_userInterfaceStyle","enabled","visible","ScreenWithHeader","Provider","value","headerTransparent","header","renderCustomHeader","headerShown","hasNativeHeader","wasNativeHeaderShown","useState","Error","tinted","templateSource","source","android","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