Migrated some common components and their dependencies to TS

This commit is contained in:
Alejandro Celaya
2020-08-29 09:19:15 +02:00
parent a96539129d
commit f40ad91ea9
25 changed files with 274 additions and 322 deletions

View File

@@ -0,0 +1,12 @@
import React, { PropsWithChildren, useEffect } from 'react';
import { RouteChildrenProps } from 'react-router';
const ScrollToTop = () => ({ location, children }: PropsWithChildren<RouteChildrenProps>) => {
useEffect(() => {
scrollTo(0, 0);
}, [ location ]);
return <React.Fragment>{children}</React.Fragment>;
};
export default ScrollToTop;