From 8660ae7ba37c3e1812bfbbf4bca31bfe3274edcf Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 8 Oct 2020 19:22:09 +0300 Subject: fix: resolve ts errors --- package-lock.json | 8 -------- package.json | 1 - src/containers/Page/Page.tsx | 8 ++------ src/containers/Page/Router.tsx | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 03961ee..e25fb85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6396,14 +6396,6 @@ "resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz", "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==" }, - "history": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/history/-/history-5.0.0.tgz", - "integrity": "sha512-3NyRMKIiFSJmIPdq7FxkNMJkQ7ZEtVblOQ38VtKaA0zZMW1Eo6Q6W8oDKEflr1kNNTItSnk4JMCO1deeSgbLLg==", - "requires": { - "@babel/runtime": "^7.7.6" - } - }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", diff --git a/package.json b/package.json index f45d4e7..2bb2500 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "bluebird": "^3.7.2", "compressorjs": "^1.0.6", "formik": "^2.1.5", - "history": "^5.0.0", "lodash": "^4.17.15", "notistack": "^0.9.17", "react": "^16.13.1", diff --git a/src/containers/Page/Page.tsx b/src/containers/Page/Page.tsx index b7e1938..e60f7da 100644 --- a/src/containers/Page/Page.tsx +++ b/src/containers/Page/Page.tsx @@ -10,10 +10,6 @@ import DynoWaiter from './DynoWaiter'; import Loading from '../../components/Loading/Loading'; import EmptyState from '../../components/EmptyState/EmptyState'; -interface HistoryChange { - state?: LocationState | null; -} - const useStyles = makeStyles(theme => ({ root: { [theme.breakpoints.down('sm')]: { @@ -32,10 +28,10 @@ const ErrorFallback: React.FC = () => ( const Page: React.FC = () => { const classes = useStyles(); const theme = useTheme(); - const history = useHistory(); + const history = useHistory(); const isMobile = useMediaQuery(theme.breakpoints.down('sm')); - useEffect(() => history.listen((update: HistoryChange) => { + useEffect(() => history.listen(update => { if (!update.state?.background) window.scrollTo(0, 0); }), [history]); diff --git a/src/containers/Page/Router.tsx b/src/containers/Page/Router.tsx index 7c3a418..7c74e9a 100644 --- a/src/containers/Page/Router.tsx +++ b/src/containers/Page/Router.tsx @@ -12,7 +12,7 @@ const Home = React.lazy(() => import('../Home/Home')); const Notifications = React.lazy(() => import('../Notifications/Notifications')); export interface LocationState { - background?: Location; + background: Location; } const Router: React.FC = React.memo(() => { -- cgit v1.2.3