Skip to content

Commit

Permalink
fix: format diff test
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrad26 committed Dec 6, 2023
1 parent 3189c5b commit 98835e3
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions packages/react/src/components/UIShell/Switcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,29 @@ const Switcher = forwardRef<HTMLUListElement, SwitcherProps>(function Switcher(
}
};

const childrenWithProps = React.Children.toArray(children).map((child, index) => {
// only setup click handlers if onChange event is passed
if (
React.isValidElement(child) &&
child.type &&
getDisplayName(child.type) === 'Switcher'
) {
const childrenWithProps = React.Children.toArray(children).map(
(child, index) => {
// only setup click handlers if onChange event is passed
if (
React.isValidElement(child) &&
child.type &&
getDisplayName(child.type) === 'Switcher'
) {
return React.cloneElement(child as React.ReactElement<any>, {
handleSwitcherItemFocus,
index,
key: index,
expanded,
});
}

return React.cloneElement(child as React.ReactElement<any>, {
handleSwitcherItemFocus,
index,
key: index,
expanded,
});
}

return React.cloneElement(child as React.ReactElement<any>, {
index,
key: index,
expanded,
});
});
);

return (
<ul
Expand Down

0 comments on commit 98835e3

Please sign in to comment.