Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Resolve warnings against missing array keys in Button #1736

Merged
merged 9 commits into from
Nov 4, 2024
4 changes: 2 additions & 2 deletions packages/react/src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const Button = forwardRef(
case !icon:
return children
case iconBefore:
return [<Icon svg={icon} size="level-5" />, children]
return [<Icon key={1} svg={icon} size="level-5" />, children]
case iconOnly:
return [
<Icon key={1} svg={icon} size="level-5" square={true} />,
Expand All @@ -57,7 +57,7 @@ export const Button = forwardRef(
</span>,
]
default:
return [children, <Icon svg={icon} size="level-5" />]
return [children, <Icon key={1} svg={icon} size="level-5" />]
}
}

Expand Down