Skip to content

Commit 3b438c6

Browse files
authored
Fix check for empty children (#1108)
1 parent 852aca1 commit 3b438c6

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

Lines changed: 5 additions & 1 deletion
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)