import { useRouter } from 'next/router';
import { useEffect, useRef } from 'react';
const useResetScroll = () => {
  const router = useRouter();
  const pathname = router?.asPath;
  const scrollRef = useRef();
  useEffect(() => {
    if (scrollRef.current) {
      scrollRef.current.scrollLeft = 0;
    }
  }, [pathname]);
  return scrollRef;
};
export default useResetScroll;