diff options
author | Anton Tananaev <anton@traccar.org> | 2022-05-23 06:44:15 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-05-23 06:44:15 -0700 |
commit | ddcb42512e95e98806db0523e4d954484a6e48cc (patch) | |
tree | 795fbd841eb94ded02ce66a2a2c50c2cc52a7dcd /modern/src/main/MainPage.js | |
parent | fdbc6762b10233950d9c84fc71a9a8c11823f0a9 (diff) | |
download | trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.gz trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.tar.bz2 trackermap-web-ddcb42512e95e98806db0523e4d954484a6e48cc.zip |
Upgrade router and navigation
Diffstat (limited to 'modern/src/main/MainPage.js')
-rw-r--r-- | modern/src/main/MainPage.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/main/MainPage.js b/modern/src/main/MainPage.js index 61c10d81..346919e2 100644 --- a/modern/src/main/MainPage.js +++ b/modern/src/main/MainPage.js @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { useHistory } from 'react-router-dom'; +import { useNavigate } from 'react-router-dom'; import { makeStyles, Paper, Toolbar, TextField, IconButton, Button, } from '@material-ui/core'; @@ -115,7 +115,7 @@ const useStyles = makeStyles((theme) => ({ const MainPage = () => { const classes = useStyles(); - const history = useHistory(); + const navigate = useNavigate(); const dispatch = useDispatch(); const theme = useTheme(); const t = useTranslation(); @@ -178,7 +178,7 @@ const MainPage = () => { placeholder={t('sharedSearchDevices')} variant="filled" /> - <IconButton onClick={() => history.push('/settings/device')} disabled={deviceReadonly}> + <IconButton onClick={() => navigate('/settings/device')} disabled={deviceReadonly}> <AddIcon /> </IconButton> {desktop && ( |