From f8e89c1163a3d344f295921ccdae0c7dcca1e329 Mon Sep 17 00:00:00 2001 From: Ruben Sibon Date: Wed, 11 Dec 2024 12:17:50 +0100 Subject: [PATCH] fix!: Make Tabs correctly handle a single Tab Button (#1775) --- packages/react/src/Tabs/Tabs.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/Tabs/Tabs.tsx b/packages/react/src/Tabs/Tabs.tsx index 476c145231..2322cb3443 100644 --- a/packages/react/src/Tabs/Tabs.tsx +++ b/packages/react/src/Tabs/Tabs.tsx @@ -5,7 +5,7 @@ import clsx from 'clsx' import { forwardRef, useEffect, useId, useImperativeHandle, useMemo, useRef, useState } from 'react' -import type { ForwardedRef, HTMLAttributes, PropsWithChildren, ReactNode } from 'react' +import type { ForwardedRef, HTMLAttributes, PropsWithChildren } from 'react' import { TabsButton } from './TabsButton' import { TabsContext } from './TabsContext' import { TabsList } from './TabsList' @@ -25,7 +25,7 @@ const TabsRoot = forwardRef( const allTabs = useMemo(() => { if (!Array.isArray(children)) return [] - return (children[0].props.children as ReactNode[]).map((child) => child) + return children[0].props.children }, [children]) useEffect(() => {