aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-10-08 19:22:09 +0300
committereug-vs <eug-vs@keemail.me>2020-10-08 19:22:09 +0300
commit8660ae7ba37c3e1812bfbbf4bca31bfe3274edcf (patch)
tree77d7707b24a287ea569521014864f7b20209d0dd /src
parent3cbf292b6d4976589428d0841cd1201057d104d4 (diff)
downloadwhich-ui-8660ae7ba37c3e1812bfbbf4bca31bfe3274edcf.tar.gz
fix: resolve ts errors
Diffstat (limited to 'src')
-rw-r--r--src/containers/Page/Page.tsx8
-rw-r--r--src/containers/Page/Router.tsx2
2 files changed, 3 insertions, 7 deletions
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<LocationState>();
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(() => {