From a6f49deeb6c56b0e78b67c645843cf68d6e227ef Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Thu, 12 Sep 2024 09:03:19 -0700 Subject: [PATCH] refactor(react): update tabbar requirement on tabs --- packages/react/src/components/navigation/IonTabs.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/react/src/components/navigation/IonTabs.tsx b/packages/react/src/components/navigation/IonTabs.tsx index 6de93bd6a8e..c23de222b5d 100644 --- a/packages/react/src/components/navigation/IonTabs.tsx +++ b/packages/react/src/components/navigation/IonTabs.tsx @@ -165,9 +165,6 @@ export const IonTabs = /*@__PURE__*/ (() => if (outlet && hasTab) { throw new Error('IonTabs cannot contain an IonRouterOutlet and an IonTab at the same time'); } - if (!tabBar) { - throw new Error('IonTabs needs a IonTabBar'); - } if (hasTab) { return ; @@ -223,11 +220,11 @@ export const IonTabs = /*@__PURE__*/ (() => ) : (
- {tabBar.props.slot === 'top' ? tabBar : null} + {tabBar?.props.slot === 'top' ? tabBar : null}
{outlet}
- {tabBar.props.slot === 'bottom' ? tabBar : null} + {tabBar?.props.slot === 'bottom' ? tabBar : null}
)}