Skip to content

Commit 5a71263

Browse files
committed
Fix check for empty children
1 parent 852aca1 commit 5a71263

File tree

1 file changed

+5
-1
lines changed
  • packages/docusaurus-theme-openapi-docs/src/theme/DiscriminatorTabs

1 file changed

+5
-1
lines changed

packages/docusaurus-theme-openapi-docs/src/theme/DiscriminatorTabs/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ function TabsComponent(props: TabProps): React.JSX.Element {
210210
export default function DiscriminatorTabs(props: TabProps): React.JSX.Element {
211211
const isBrowser = useIsBrowser();
212212

213-
if (!props.length) return <React.Fragment />;
213+
if (
214+
!props.children ||
215+
(Array.isArray(props.children) && props.children.length === 0)
216+
)
217+
return <React.Fragment />;
214218

215219
return (
216220
<TabsComponent

0 commit comments

Comments
 (0)