Skip to content

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

fixing react warnings

Ilian Sapundshiev565952c55feb
diff --git a/app/components/TagLibrary.js b/app/components/TagLibrary.js
index ca72cc8f3..129346882 100644
--- a/app/components/TagLibrary.js
+++ b/app/components/TagLibrary.js
@@ -259,7 +259,7 @@ class TagLibrary extends React.Component<Props, State> {
if (this.props.isReadOnlyMode) {
return (
<TagContainer
- key={tag.id}
+ key={uuidv1()}
tag={tag}
tagGroup={tagGroup}
handleTagMenu={this.handleTagMenu}
@@ -271,7 +271,7 @@ class TagLibrary extends React.Component<Props, State> {
}
return (
<TagContainerDnd
- key={tag.id}
+ key={uuidv1()}
tag={tag}
tagGroup={tagGroup}
handleTagMenu={this.handleTagMenu}
@@ -285,7 +285,7 @@ class TagLibrary extends React.Component<Props, State> {
</TagGroupContainer>
</Collapse>
</div>
- )
+ );
};
render() {
diff --git a/app/components/dialogs/AddRemoveTagsDialog.js b/app/components/dialogs/AddRemoveTagsDialog.js
index fada7fe0e..38e6e358a 100644
--- a/app/components/dialogs/AddRemoveTagsDialog.js
+++ b/app/components/dialogs/AddRemoveTagsDialog.js
@@ -18,6 +18,7 @@
*/
import React from 'react';
+import uuidv1 from 'uuid';
import withMobileDialog from '@material-ui/core/withMobileDialog';
import Button from '@material-ui/core/Button';
import DialogActions from '@material-ui/core/DialogActions';
@@ -119,7 +120,7 @@ class AddRemoveTagsDialog extends React.Component<Props, State> {
<TagsSelect placeholderText={i18n.t('core:selectTags')} tags={newlyAddedTags} handleChange={this.handleChange} />
<List dense style={{ width: 550 }}>
{selectedEntries.length > 0 && selectedEntries.map((entry) => (
- <ListItem title={entry.path}>
+ <ListItem key={uuidv1()} title={entry.path}>
<ListItemIcon>
<FileIcon />
</ListItemIcon>
diff --git a/app/perspectives/grid-perspective/components/CellContent.js b/app/perspectives/grid-perspective/components/CellContent.js
index 2d8092d9d..0ee7226d4 100644
--- a/app/perspectives/grid-perspective/components/CellContent.js
+++ b/app/perspectives/grid-perspective/components/CellContent.js
@@ -18,6 +18,7 @@
*/
import React from 'react';
+import uuidv1 from 'uuid';
import formatDistance from 'date-fns/formatDistance';
import removeMd from 'remove-markdown';
import classNames from 'classnames';
@@ -274,7 +275,7 @@ const CellContent = (props: Props) => {
return isReadOnlyMode ? (
<TagContainer
tag={tag}
- key={tag.id}
+ key={uuidv1()}
entryPath={fsEntry.path}
addTags={addTags}
handleTagMenu={handleTagMenu}
@@ -283,7 +284,7 @@ const CellContent = (props: Props) => {
) : (
<TagContainerDnd
tag={tag}
- key={tag.id}
+ key={uuidv1()}
entryPath={fsEntry.path}
addTags={addTags}
handleTagMenu={handleTagMenu}