From d8fd374b12c9cfc7452a3949e70a6995dc9f5843 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 14 May 2024 17:03:24 +0200 Subject: [PATCH] scrollTop on Url Location change --- src/App.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/App.js b/src/App.js index 859bd94..805e9b3 100644 --- a/src/App.js +++ b/src/App.js @@ -21,6 +21,10 @@ import React, { useEffect, useRef } from "react"; function App() { const location = useLocation(); + useEffect(() => { + window.scrollTo(0, 0); + }, [location]); + return ( <> {/* */}