Skip to content

Commit

Permalink
Merge pull request #811 from illacloud/fix/tabs-default-value
Browse files Browse the repository at this point in the history
Fix/tabs default value
  • Loading branch information
Wangtaofeng authored Nov 24, 2023
2 parents fa3f5b3 + f4bd338 commit a6b0ce3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/tabs/src/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ export const Tabs = forwardRef<HTMLDivElement, TabsProps>((props, ref) => {
return getTabItems(children as ReactElement)
}, [children])

const [curTabItems, setCurTabItems] = useState<ReactElement[]>(
[...tabItems] ?? [],
)
const [curTabItems, setCurTabItems] = useState<ReactElement[]>(tabItems)
const firstTabKey = useMemo(() => {
return curTabItems[0]?.key?.toString()
}, [curTabItems])
Expand Down

0 comments on commit a6b0ce3

Please sign in to comment.