From ddcb42512e95e98806db0523e4d954484a6e48cc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 23 May 2022 06:44:15 -0700 Subject: Upgrade router and navigation --- modern/src/settings/components/CollectionActions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modern/src/settings/components/CollectionActions.js') diff --git a/modern/src/settings/components/CollectionActions.js b/modern/src/settings/components/CollectionActions.js index 98226269..3fef1203 100644 --- a/modern/src/settings/components/CollectionActions.js +++ b/modern/src/settings/components/CollectionActions.js @@ -1,21 +1,21 @@ import React, { useState } from 'react'; import { IconButton, Menu, MenuItem } from '@material-ui/core'; import MoreVertIcon from '@material-ui/icons/MoreVert'; -import { useHistory } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import RemoveDialog from '../../common/components/RemoveDialog'; import { useTranslation } from '../../common/components/LocalizationProvider'; const CollectionActions = ({ itemId, editPath, endpoint, setTimestamp, }) => { - const history = useHistory(); + const navigate = useNavigate(); const t = useTranslation(); const [menuAnchorEl, setMenuAnchorEl] = useState(null); const [removing, setRemoving] = useState(false); const handleEdit = () => { - history.push(`${editPath}/${itemId}`); + navigate(`${editPath}/${itemId}`); setMenuAnchorEl(null); }; -- cgit v1.2.3