mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-30 05:15:25 +08:00
fix: show a missing icon symbol instead of empty area in bottom tab bar
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -37,7 +37,7 @@ type Props = {
|
||||
/**
|
||||
* Icon to display for the tab.
|
||||
*/
|
||||
icon?: (props: {
|
||||
icon: (props: {
|
||||
focused: boolean;
|
||||
size: number;
|
||||
color: string;
|
||||
|
||||
Reference in New Issue
Block a user