mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
fix annoying react error "missing unique key prop"
This commit is contained in:
committed by
René Pfeuffer
parent
2087c27671
commit
6343eddeb3
@@ -52,7 +52,13 @@ const SplitAndReplace: FC<Props> = ({ text, replacements }) => {
|
|||||||
if (parts.length === 0) {
|
if (parts.length === 0) {
|
||||||
return <>{parts[0]}</>;
|
return <>{parts[0]}</>;
|
||||||
}
|
}
|
||||||
return <>{parts}</>;
|
return (
|
||||||
|
<>
|
||||||
|
{parts.map((part, index) => (
|
||||||
|
<React.Fragment key={index}>{part}</React.Fragment>
|
||||||
|
))}
|
||||||
|
</>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default SplitAndReplace;
|
export default SplitAndReplace;
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ class ChangesetDetails extends React.Component<Props, State> {
|
|||||||
const description = changesets.parseDescription(changeset.description);
|
const description = changesets.parseDescription(changeset.description);
|
||||||
const id = <ChangesetId repository={repository} changeset={changeset} link={false} />;
|
const id = <ChangesetId repository={repository} changeset={changeset} link={false} />;
|
||||||
const date = <DateFromNow date={changeset.date} />;
|
const date = <DateFromNow date={changeset.date} />;
|
||||||
const parents = changeset._embedded.parents.map((parent: ParentChangeset) => (
|
const parents = changeset._embedded.parents.map((parent: ParentChangeset, index: number) => (
|
||||||
<ReactLink title={parent.id} to={parent.id}>
|
<ReactLink title={parent.id} to={parent.id} key={index}>
|
||||||
{parent.id.substring(0, 7)}
|
{parent.id.substring(0, 7)}
|
||||||
</ReactLink>
|
</ReactLink>
|
||||||
));
|
));
|
||||||
|
|||||||
Reference in New Issue
Block a user