Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix missing key on react components

Ilian Sapundshiev22bfd878bfe0
diff --git a/app/components/dialogs/ConfirmDialog.tsx b/app/components/dialogs/ConfirmDialog.tsx
index d86363ebc..fb33f6f4c 100644
--- a/app/components/dialogs/ConfirmDialog.tsx
+++ b/app/components/dialogs/ConfirmDialog.tsx
@@ -55,7 +55,7 @@ const ConfirmDialog = (props: Props) => {
{props.content}
{props.list &&
props.list.map(listItem => (
- <ListItem title={listItem}>
+ <ListItem title={listItem} key={listItem.toString()}>
<Typography variant="inherit" noWrap>
{listItem}
</Typography>
diff --git a/app/components/dialogs/MoveCopyFilesDialog.tsx b/app/components/dialogs/MoveCopyFilesDialog.tsx
index c13476168..19472cff7 100644
--- a/app/components/dialogs/MoveCopyFilesDialog.tsx
+++ b/app/components/dialogs/MoveCopyFilesDialog.tsx
@@ -123,7 +123,7 @@ const MoveCopyFilesDialog = (props: Props) => {
{props.selectedFiles &&
props.selectedFiles.length > 0 &&
props.selectedFiles.map(path => (
- <ListItem title={path}>
+ <ListItem title={path} key={path}>
<ListItemIcon>
<FileIcon />
</ListItemIcon>
diff --git a/app/perspectives/grid-perspective/components/MainContainer.tsx b/app/perspectives/grid-perspective/components/MainContainer.tsx
index cb9dac9ea..96eb18999 100644
--- a/app/perspectives/grid-perspective/components/MainContainer.tsx
+++ b/app/perspectives/grid-perspective/components/MainContainer.tsx
@@ -631,12 +631,14 @@ class GridPerspective extends React.Component<Props, State> {
</TagDropContainer>
);
+ const key = fsEntry.path;
+
if (fsEntry.isFile) {
- return <FileSourceDnd>{cellContent}</FileSourceDnd>;
+ return <FileSourceDnd key={key}>{cellContent}</FileSourceDnd>;
}
return (
- <div style={{ position: 'relative' }}>
+ <div style={{ position: 'relative' }} key={key}>
<TargetMoveFileBox
// @ts-ignore
accepts={[DragItemTypes.FILE]}