fix: Breadcrumb 默认使用path作为唯一key (#21583)

* Breadcrumb 默认使用path作为唯一key

* update&submit jest snapshot
This commit is contained in:
douxc 2020-02-27 11:00:57 +08:00 committed by GitHub
parent afedb4127f
commit 12761e8382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -103,7 +103,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
overlay = (
<Menu>
{route.children.map(child => (
<Menu.Item key={child.breadcrumbName || child.path}>
<Menu.Item key={child.path || child.breadcrumbName}>
{itemRender(child, params, routes, this.addChildPath(paths, child.path, params))}
</Menu.Item>
))}
@ -112,7 +112,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
}
return (
<BreadcrumbItem overlay={overlay} separator={separator} key={route.breadcrumbName || path}>
<BreadcrumbItem overlay={overlay} separator={separator} key={path || route.breadcrumbName}>
{itemRender(route, params, routes, paths)}
</BreadcrumbItem>
);

View File

@ -100,7 +100,7 @@ exports[`react router react router 3 1`] = `
</span>
</BreadcrumbItem>
<BreadcrumbItem
key="Application List"
key="apps"
separator="/"
>
<span>
@ -121,7 +121,7 @@ exports[`react router react router 3 1`] = `
</span>
</BreadcrumbItem>
<BreadcrumbItem
key="Application:id"
key="1"
separator="/"
>
<span>
@ -142,7 +142,7 @@ exports[`react router react router 3 1`] = `
</span>
</BreadcrumbItem>
<BreadcrumbItem
key="Detail"
key="detail"
separator="/"
>
<span>