mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +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) {
|
||||
return <>{parts[0]}</>;
|
||||
}
|
||||
return <>{parts}</>;
|
||||
return (
|
||||
<>
|
||||
{parts.map((part, index) => (
|
||||
<React.Fragment key={index}>{part}</React.Fragment>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default SplitAndReplace;
|
||||
|
||||
@@ -174,8 +174,8 @@ class ChangesetDetails extends React.Component<Props, State> {
|
||||
const description = changesets.parseDescription(changeset.description);
|
||||
const id = <ChangesetId repository={repository} changeset={changeset} link={false} />;
|
||||
const date = <DateFromNow date={changeset.date} />;
|
||||
const parents = changeset._embedded.parents.map((parent: ParentChangeset) => (
|
||||
<ReactLink title={parent.id} to={parent.id}>
|
||||
const parents = changeset._embedded.parents.map((parent: ParentChangeset, index: number) => (
|
||||
<ReactLink title={parent.id} to={parent.id} key={index}>
|
||||
{parent.id.substring(0, 7)}
|
||||
</ReactLink>
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user