import { useLocation } from "onefx/lib/react-router" ; import React , { useEffect } from "react" ; type Props = { children : Array < JSX . Element > | JSX . Element | React . Component ; } ; export const ScrollToTop = ( { children } ) => { const location = useLocation ( ) ; useEffect ( ( ) => { window . document . documentElement . scrollTop = 0 ; window . ga && window . ga ( "send" , "pageview" ) ; } , [ location ] ) ; return < > { children } < />; } ;