fix: show a missing icon symbol instead of empty area in bottom tab bar

This commit is contained in:
Satyajit Sahoo
2021-03-06 19:00:38 +01:00
parent 36a9b4f866
commit 2bc4882692
5 changed files with 33 additions and 2 deletions

View File

@@ -17,6 +17,7 @@ import {
useTheme,
useLinkBuilder,
} from '@react-navigation/native';
import { MissingIcon } from '@react-navigation/elements';
import { EdgeInsets, useSafeAreaFrame } from 'react-native-safe-area-context';
import BottomTabItem from './BottomTabItem';
@@ -348,7 +349,12 @@ export default function BottomTabBar({
options.tabBarInactiveBackgroundColor
}
button={options.tabBarButton}
icon={options.tabBarIcon}
icon={
options.tabBarIcon ??
(({ color, size }) => (
<MissingIcon color={color} size={size} />
))
}
badge={options.tabBarBadge}
badgeStyle={options.tabBarBadgeStyle}
label={label}

View File

@@ -37,7 +37,7 @@ type Props = {
/**
* Icon to display for the tab.
*/
icon?: (props: {
icon: (props: {
focused: boolean;
size: number;
color: string;