fix:breadcrumd 漏了 key (#1743)

This commit is contained in:
吴多益 2021-04-04 21:42:13 +08:00 committed by GitHub
parent 86d0c0ed3d
commit c82e451bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,8 +80,8 @@ export class BreadcrumbField extends React.Component<BreadcrumbProps, object> {
: (resolveVariable(source, data) as Array<BreadcrumbItemSchema>);
const crumbs = crumbItems
.map<React.ReactNode>(item => (
<span className={cx('Breadcrumb-item', itemClassName)}>
.map<React.ReactNode>((item, index) => (
<span className={cx('Breadcrumb-item', itemClassName)} key={index}>
{item.icon
? generateIcon(cx, item.icon, 'Icon', 'Breadcrumb-icon')
: null}
@ -92,9 +92,12 @@ export class BreadcrumbField extends React.Component<BreadcrumbProps, object> {
)}
</span>
))
.reduce((prev, curr) => [
.reduce((prev, curr, index) => [
prev,
<span className={cx('Breadcrumb-separator', separatorClassName)}>
<span
className={cx('Breadcrumb-separator', separatorClassName)}
key={`separator-${index}`}
>
{separator}
</span>,
curr