Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions packages/react-native-bottom-tabs/src/Screen.tsx

This file was deleted.

24 changes: 15 additions & 9 deletions packages/react-native-bottom-tabs/src/TabView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import type { TabViewItems } from './TabViewNativeComponent';
import Screen from './Screen';
import {
type ColorValue,
Image,
Expand All @@ -16,6 +15,7 @@
import NativeTabView from './TabViewNativeComponent';
import useLatestCallback from 'use-latest-callback';
import type { BaseRoute, NavigationState } from './types';
import DelayedFreeze from './DelayedFreeze';

const isAppleSymbol = (icon: any): icon is { sfSymbol: string } =>
icon?.sfSymbol;
Expand Down Expand Up @@ -219,7 +219,7 @@

if (!loaded.includes(focusedKey)) {
// Set the current tab to be loaded if it was not loaded before
setLoaded((loaded) => [...loaded, focusedKey]);

Check warning on line 222 in packages/react-native-bottom-tabs/src/TabView.tsx

View workflow job for this annotation

GitHub Actions / lint

'loaded' is already declared in the upper scope on line 218 column 10
}

const icons = React.useMemo(
Expand Down Expand Up @@ -330,20 +330,26 @@
const freeze = !focused ? getFreezeOnBlur({ route }) : false;

return (
<Screen
<View
key={route.key}
freeze={!!freeze}
focused={focused}
style={[
styles.screen,
renderCustomTabBar ? styles.fullWidth : measuredDimensions,
]}
collapsable={false}
pointerEvents={focused ? 'auto' : 'none'}
accessibilityElementsHidden={!focused}
importantForAccessibility={
focused ? 'auto' : 'no-hide-descendants'
}
>
{renderScene({
route,
jumpTo,
})}
</Screen>
<DelayedFreeze freeze={!!freeze}>
{renderScene({
route,
jumpTo,
})}
</DelayedFreeze>
</View>
);
})}
</NativeTabView>
Expand Down
Loading