import * as React from 'react';
import { useLocation } from 'react-router-dom';
import { runtime } from './adapter';

export function useScrollTop() {
  const { pathname } = useLocation();
  React.useEffect(() => {
    runtime.scrollTo(0, 0);
  }, [pathname]);
  return null;
}
