@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,9 +1,8 @@
1
1
  import {
2
- getHeaderTitle,
3
- Header,
2
+ Container,
3
+ Lazy,
4
4
  SafeAreaProviderCompat,
5
- Screen,
6
- } from '@react-navigation/elements';
5
+ } from '@react-navigation/elements/internal';
7
6
  import {
8
7
  type NavigationAction,
9
8
  type ParamListBase,
@@ -11,8 +10,14 @@ import {
11
10
  type TabNavigationState,
12
11
  } from '@react-navigation/native';
13
12
  import * as React from 'react';
14
- import { Animated, Platform, StyleSheet } from 'react-native';
15
- import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
13
+ import {
14
+ Animated,
15
+ Platform,
16
+ type StyleProp,
17
+ StyleSheet,
18
+ type ViewStyle,
19
+ } from 'react-native';
20
+ import { Screen, ScreenContainer } from 'react-native-screens';
16
21
 
17
22
  import {
18
23
  FadeTransition,
@@ -21,17 +26,18 @@ import {
21
26
  import type {
22
27
  BottomTabBarProps,
23
28
  BottomTabDescriptorMap,
24
- BottomTabHeaderProps,
25
29
  BottomTabNavigationConfig,
26
30
  BottomTabNavigationHelpers,
27
31
  BottomTabNavigationOptions,
28
- BottomTabNavigationProp,
32
+ BottomTabSceneStyleInterpolator,
29
33
  } from '../types';
34
+ import { BottomTabAnimationContext } from '../utils/BottomTabAnimationContext';
30
35
  import { BottomTabBarHeightCallbackContext } from '../utils/BottomTabBarHeightCallbackContext';
31
36
  import { BottomTabBarHeightContext } from '../utils/BottomTabBarHeightContext';
32
37
  import { useAnimatedHashMap } from '../utils/useAnimatedHashMap';
38
+ import { useTabBarPosition } from '../utils/useTabBarPosition';
33
39
  import { BottomTabBar, getTabBarHeight } from './BottomTabBar';
34
- import { MaybeScreen, MaybeScreenContainer } from './ScreenFallback';
40
+ import { ScreenContent } from './ScreenContent';
35
41
 
36
42
  type Props = BottomTabNavigationConfig & {
37
43
  state: TabNavigationState<ParamListBase>;
@@ -72,29 +78,17 @@ const renderTabBarDefault = (props: BottomTabBarProps) => (
72
78
  <BottomTabBar {...props} />
73
79
  );
74
80
 
75
- export function BottomTabView(props: Props) {
76
- const {
77
- tabBar = renderTabBarDefault,
78
- state,
79
- navigation,
80
- descriptors,
81
- safeAreaInsets,
82
- detachInactiveScreens = Platform.OS === 'web' ||
83
- Platform.OS === 'android' ||
84
- Platform.OS === 'ios',
85
- } = props;
86
-
87
- const focusedRouteKey = state.routes[state.index].key;
88
-
89
- /**
90
- * List of loaded tabs, tabs will be loaded when navigated to.
91
- */
92
- const [loaded, setLoaded] = React.useState([focusedRouteKey]);
93
-
94
- if (!loaded.includes(focusedRouteKey)) {
95
- // Set the current tab to be loaded if it was not loaded before
96
- setLoaded([...loaded, focusedRouteKey]);
97
- }
81
+ export function BottomTabViewCustom({
82
+ tabBar = renderTabBarDefault,
83
+ state,
84
+ navigation,
85
+ descriptors,
86
+ detachInactiveScreens = Platform.OS === 'web' ||
87
+ Platform.OS === 'android' ||
88
+ Platform.OS === 'ios',
89
+ }: Props) {
90
+ const { routes } = state;
91
+ const focusedRouteKey = routes[state.index].key;
98
92
 
99
93
  const previousRouteKeyRef = React.useRef(focusedRouteKey);
100
94
  const tabAnims = useAnimatedHashMap(state);
@@ -187,58 +181,38 @@ export function BottomTabView(props: Props) {
187
181
  tabAnims,
188
182
  ]);
189
183
 
190
- const dimensions = SafeAreaProviderCompat.initialMetrics.frame;
191
184
  const [tabBarHeight, setTabBarHeight] = React.useState(() =>
192
185
  getTabBarHeight({
193
186
  state,
194
187
  descriptors,
195
- dimensions,
196
- insets: {
197
- ...SafeAreaProviderCompat.initialMetrics.insets,
198
- ...props.safeAreaInsets,
199
- },
200
- style: descriptors[state.routes[state.index].key].options.tabBarStyle,
188
+ dimensions: SafeAreaProviderCompat.initialMetrics.frame,
189
+ insets: SafeAreaProviderCompat.initialMetrics.insets,
190
+ style: descriptors[focusedRouteKey].options.tabBarStyle,
201
191
  })
202
192
  );
203
193
 
204
- const renderTabBar = () => {
205
- return (
206
- <SafeAreaInsetsContext.Consumer>
207
- {(insets) =>
208
- tabBar({
209
- state: state,
210
- descriptors: descriptors,
211
- navigation: navigation,
212
- insets: {
213
- top: safeAreaInsets?.top ?? insets?.top ?? 0,
214
- right: safeAreaInsets?.right ?? insets?.right ?? 0,
215
- bottom: safeAreaInsets?.bottom ?? insets?.bottom ?? 0,
216
- left: safeAreaInsets?.left ?? insets?.left ?? 0,
217
- },
218
- })
219
- }
220
- </SafeAreaInsetsContext.Consumer>
221
- );
222
- };
223
-
224
- const { routes } = state;
225
-
226
- // If there is no animation, we only have 2 states: visible and invisible
227
- const hasTwoStates = !routes.some((route) =>
228
- hasAnimation(descriptors[route.key].options)
229
- );
230
-
231
- const { tabBarPosition = 'bottom' } = descriptors[focusedRouteKey].options;
232
-
233
194
  const tabBarElement = (
234
195
  <BottomTabBarHeightCallbackContext.Provider
235
196
  key="tabbar"
236
197
  value={setTabBarHeight}
237
198
  >
238
- {renderTabBar()}
199
+ {tabBar({
200
+ state: state,
201
+ descriptors: descriptors,
202
+ navigation: navigation,
203
+ })}
239
204
  </BottomTabBarHeightCallbackContext.Provider>
240
205
  );
241
206
 
207
+ // If there is no animation, we only have 2 states: visible and invisible
208
+ const hasTwoStates = !routes.some((route) =>
209
+ hasAnimation(descriptors[route.key].options)
210
+ );
211
+
212
+ const tabBarPosition = useTabBarPosition(
213
+ descriptors[focusedRouteKey].options
214
+ );
215
+
242
216
  return (
243
217
  <SafeAreaProviderCompat
244
218
  style={{
@@ -251,7 +225,7 @@ export function BottomTabView(props: Props) {
251
225
  {tabBarPosition === 'top' || tabBarPosition === 'left'
252
226
  ? tabBarElement
253
227
  : null}
254
- <MaybeScreenContainer
228
+ <ScreenContainer
255
229
  key="screens"
256
230
  enabled={detachInactiveScreens}
257
231
  hasTwoStates={hasTwoStates}
@@ -259,48 +233,67 @@ export function BottomTabView(props: Props) {
259
233
  >
260
234
  {routes.map((route, index) => {
261
235
  const descriptor = descriptors[route.key];
236
+
237
+ const { navigation, options, render } = descriptor;
238
+
262
239
  const {
263
240
  lazy = true,
264
241
  animation = 'none',
265
242
  sceneStyleInterpolator = NAMED_TRANSITIONS_PRESETS[animation]
266
243
  .sceneStyleInterpolator,
267
- } = descriptor.options;
244
+ sceneStyle: customSceneStyle,
245
+ } = options;
246
+
268
247
  const isFocused = state.index === index;
269
248
  const isPreloaded = state.preloadedRouteKeys.includes(route.key);
270
249
 
271
- if (
272
- lazy &&
273
- !loaded.includes(route.key) &&
274
- !isFocused &&
275
- !isPreloaded
276
- ) {
277
- // Don't render a lazy screen if we've never navigated to it or it wasn't preloaded
278
- return null;
279
- }
250
+ const animationEnabled = hasAnimation(descriptor.options);
280
251
 
281
- const {
282
- freezeOnBlur,
283
- header = ({ layout, options }: BottomTabHeaderProps) => (
284
- <Header
285
- {...options}
286
- layout={layout}
287
- title={getHeaderTitle(options, route.name)}
288
- />
289
- ),
290
- headerShown,
291
- headerStatusBarHeight,
292
- headerTransparent,
293
- sceneStyle: customSceneStyle,
294
- } = descriptor.options;
252
+ const content = (
253
+ <AnimatedScreenContent
254
+ progress={tabAnims[route.key]}
255
+ animationEnabled={animationEnabled}
256
+ sceneStyleInterpolator={sceneStyleInterpolator}
257
+ style={customSceneStyle}
258
+ >
259
+ <Lazy enabled={lazy} visible={isFocused || isPreloaded}>
260
+ <ScreenContent
261
+ isFocused={isFocused}
262
+ route={route}
263
+ navigation={navigation}
264
+ options={options}
265
+ >
266
+ <BottomTabBarHeightContext.Provider
267
+ value={tabBarPosition === 'bottom' ? tabBarHeight : 0}
268
+ >
269
+ {render()}
270
+ </BottomTabBarHeightContext.Provider>
271
+ </ScreenContent>
272
+ </Lazy>
273
+ </AnimatedScreenContent>
274
+ );
295
275
 
296
- const { sceneStyle } =
297
- sceneStyleInterpolator?.({
298
- current: {
299
- progress: tabAnims[route.key],
300
- },
301
- }) ?? {};
276
+ if (Platform.OS === 'web') {
277
+ /**
278
+ * Don't use react-native-screens on web:
279
+ * - It applies display: none as fallback, which triggers `onLayout` events
280
+ * - We still need to hide the view when screens is not enabled
281
+ * - We can use `inert` to handle a11y better for unfocused screens
282
+ */
283
+ return (
284
+ <Container
285
+ key={route.key}
286
+ inert={!isFocused}
287
+ style={{
288
+ ...StyleSheet.absoluteFillObject,
289
+ visibility: isFocused ? 'visible' : 'hidden',
290
+ }}
291
+ >
292
+ {content}
293
+ </Container>
294
+ );
295
+ }
302
296
 
303
- const animationEnabled = hasAnimation(descriptor.options);
304
297
  const activityState = isFocused
305
298
  ? STATE_ON_TOP // the screen is on top after the transition
306
299
  : animationEnabled // is animation is not enabled, immediately move to inactive state
@@ -316,40 +309,24 @@ export function BottomTabView(props: Props) {
316
309
  : STATE_INACTIVE;
317
310
 
318
311
  return (
319
- <MaybeScreen
312
+ <Screen
320
313
  key={route.key}
321
- style={[StyleSheet.absoluteFill, { zIndex: isFocused ? 0 : -1 }]}
322
- active={activityState}
314
+ style={[
315
+ StyleSheet.absoluteFill,
316
+ {
317
+ zIndex: isFocused ? 0 : -1,
318
+ pointerEvents: isFocused ? 'auto' : 'none',
319
+ },
320
+ ]}
321
+ activityState={activityState}
323
322
  enabled={detachInactiveScreens}
324
- freezeOnBlur={freezeOnBlur}
325
323
  shouldFreeze={activityState === STATE_INACTIVE && !isPreloaded}
326
324
  >
327
- <BottomTabBarHeightContext.Provider
328
- value={tabBarPosition === 'bottom' ? tabBarHeight : 0}
329
- >
330
- <Screen
331
- focused={isFocused}
332
- route={descriptor.route}
333
- navigation={descriptor.navigation}
334
- headerShown={headerShown}
335
- headerStatusBarHeight={headerStatusBarHeight}
336
- headerTransparent={headerTransparent}
337
- header={header({
338
- layout: dimensions,
339
- route: descriptor.route,
340
- navigation:
341
- descriptor.navigation as BottomTabNavigationProp<ParamListBase>,
342
- options: descriptor.options,
343
- })}
344
- style={[customSceneStyle, animationEnabled && sceneStyle]}
345
- >
346
- {descriptor.render()}
347
- </Screen>
348
- </BottomTabBarHeightContext.Provider>
349
- </MaybeScreen>
325
+ {content}
326
+ </Screen>
350
327
  );
351
328
  })}
352
- </MaybeScreenContainer>
329
+ </ScreenContainer>
353
330
  {tabBarPosition === 'bottom' || tabBarPosition === 'right'
354
331
  ? tabBarElement
355
332
  : null}
@@ -357,9 +334,45 @@ export function BottomTabView(props: Props) {
357
334
  );
358
335
  }
359
336
 
337
+ function AnimatedScreenContent({
338
+ progress,
339
+ animationEnabled,
340
+ sceneStyleInterpolator,
341
+ children,
342
+ style,
343
+ }: {
344
+ progress: Animated.Value;
345
+ animationEnabled: boolean;
346
+ sceneStyleInterpolator?: BottomTabSceneStyleInterpolator;
347
+ children: React.ReactNode;
348
+ style: StyleProp<ViewStyle>;
349
+ }) {
350
+ const interpolationProps = React.useMemo(() => {
351
+ return {
352
+ current: { progress },
353
+ };
354
+ }, [progress]);
355
+
356
+ const { sceneStyle } = sceneStyleInterpolator?.(interpolationProps) ?? {};
357
+
358
+ return (
359
+ <Animated.View
360
+ style={[styles.scene, style, animationEnabled && sceneStyle]}
361
+ >
362
+ <BottomTabAnimationContext.Provider value={interpolationProps}>
363
+ {children}
364
+ </BottomTabAnimationContext.Provider>
365
+ </Animated.View>
366
+ );
367
+ }
368
+
360
369
  const styles = StyleSheet.create({
361
370
  screens: {
362
371
  flex: 1,
363
372
  overflow: 'hidden',
364
373
  },
374
+ scene: {
375
+ flex: 1,
376
+ pointerEvents: 'box-none',
377
+ },
365
378
  });
@@ -0,0 +1 @@
1
+ export * from './BottomTabViewNativeImpl';
@@ -0,0 +1 @@
1
+ export * from './BottomTabViewNativeImpl';
@@ -0,0 +1,3 @@
1
+ import { BottomTabViewCustom } from './BottomTabViewCustom';
2
+
3
+ export { BottomTabViewCustom as BottomTabViewNative };