unique "key" prop added
This commit is contained in:
parent
bf344fc561
commit
279e507939
|
@ -61,12 +61,16 @@ export class TitleBar extends React.Component<Props, State> {
|
||||||
public renderBreadcrumb(): JSX.Element[] {
|
public renderBreadcrumb(): JSX.Element[] {
|
||||||
let elems: JSX.Element[] = new Array();
|
let elems: JSX.Element[] = new Array();
|
||||||
let pathArr = this.props.location.split('/');
|
let pathArr = this.props.location.split('/');
|
||||||
|
let index: number = 0;
|
||||||
|
|
||||||
for (let item of pathArr) {
|
for (let item of pathArr) {
|
||||||
if (item !== '' && !item.match(/^\d+$/)) {
|
if (item !== '' && !item.match(/^\d+$/)) {
|
||||||
let path = '/' + item;
|
let path = '/' + item;
|
||||||
elems.push(<Breadcrumb.Section onClick={this.handleBreadcrumb.bind(this, path)}>{this.capitalizeFirst(item)}</Breadcrumb.Section>);
|
elems.push(
|
||||||
elems.push(<Breadcrumb.Divider />);
|
<Breadcrumb.Section key={index++} onClick={this.handleBreadcrumb.bind(this, path)}>
|
||||||
|
{this.capitalizeFirst(item)}
|
||||||
|
</Breadcrumb.Section>);
|
||||||
|
elems.push(<Breadcrumb.Divider key={index++}/>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return elems;
|
return elems;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user