Skip to content

Commit

Permalink
fix(Tab): children must be array when spreading
Browse files Browse the repository at this point in the history
  • Loading branch information
YossiSaadi authored Apr 4, 2024
1 parent befa866 commit 62bf475
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/components/Tabs/Tab/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,13 @@ const Tab: FC<TabProps> = forwardRef(
/>
);

const childrenArray = React.Children.toArray(children);

if (iconSide === "left") {
return [iconElement, ...children];
return [iconElement, ...childrenArray];
}

return [...children, iconElement];
return [...childrenArray, iconElement];
}
return (
<li
Expand Down

0 comments on commit 62bf475

Please sign in to comment.