Skip to content

Commit

Permalink
fix: typescript rules for ReactElement usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrad26 authored Dec 6, 2023
1 parent 8c9c766 commit e62e9be
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,10 @@ export default class ContentSwitcher extends React.Component<
role="tablist"
onChange={undefined}>
{children &&
React.Children.toArray(children).map((child: ReactElement, index) =>
React.cloneElement(child, {
React.Children.toArray(children).map((child, index) => {
child = child as ReactElement;

return React.cloneElement(child, {
index,
onClick: composeEventHandlers([
this.handleChildChange,
Expand All @@ -239,8 +241,8 @@ export default class ContentSwitcher extends React.Component<
selected: index === this.state.selectedIndex,
ref: this.handleItemRef(index),
size,
})
)}
});
})}
</LayoutConstraint>
);
}
Expand Down

0 comments on commit e62e9be

Please sign in to comment.