Skip to content

Commit

Permalink
fix!: Make Tabs correctly handle a single Tab Button (#1775)
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenSibon authored Dec 11, 2024
1 parent 2ec0102 commit f8e89c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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(() => {
Expand Down

0 comments on commit f8e89c1

Please sign in to comment.