Skip to content

Commit

Permalink
fix: remove tab bar icon workaround (#157)
Browse files Browse the repository at this point in the history
* fix: remove tab bar icon workaround

* Create bright-pianos-invite.md
  • Loading branch information
okwasniewski authored Nov 22, 2024
1 parent f128b02 commit 153f5f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/bright-pianos-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bottom-tabs/react-navigation": patch
---

fix: remove `tabBarIcon` from experimental API
6 changes: 0 additions & 6 deletions packages/react-navigation/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ export type NativeBottomTabNavigationOptions = {
*/
tabBarIcon?: (props: { focused: boolean }) => ImageSourcePropType | AppleIcon;

/**
* Whether the tab bar item is visible when this screen is active.
* Used for compatibility with JS Tabs. Prefer using `tabBarItemHidden` as this API may be removed in the future.
*/
tabBarButton?: () => null;

/**
* Whether the tab bar item is visible. Defaults to true.
*/
Expand Down
6 changes: 1 addition & 5 deletions packages/react-navigation/src/views/NativeBottomTabView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ export default function NativeBottomTabView({
getBadge={({ route }) => descriptors[route.key]?.options.tabBarBadge}
getHidden={({ route }) => {
const options = descriptors[route.key]?.options;

return (
options?.tabBarItemHidden === true ||
options?.tabBarButton?.() === null
);
return options?.tabBarItemHidden === true;
}}
getIcon={({ route, focused }) => {
const options = descriptors[route.key]?.options;
Expand Down

0 comments on commit 153f5f7

Please sign in to comment.