File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { BrowserRouter , Routes , Route , useLocation } from "react-router-dom" ;
2
+ import { useLayoutEffect } from "react" ;
2
3
import Editor from "./pages/Editor" ;
3
4
import Survey from "./pages/Survey" ;
4
5
import BugReport from "./pages/BugReport" ;
5
6
import Shortcuts from "./pages/Shortcuts" ;
6
7
import Templates from "./pages/Templates" ;
7
- import { useEffect , useLayoutEffect } from "react" ;
8
8
import LandingPage from "./pages/LandingPage" ;
9
9
import SettingsContextProvider from "./context/SettingsContext" ;
10
10
import useSettings from "./hooks/useSettings" ;
@@ -82,7 +82,7 @@ function ThemedPage({ children }) {
82
82
83
83
function RestoreScroll ( ) {
84
84
const location = useLocation ( ) ;
85
- useEffect ( ( ) => {
85
+ useLayoutEffect ( ( ) => {
86
86
window . scroll ( 0 , 0 ) ;
87
87
} , [ location . pathname ] ) ;
88
88
return null ;
You can’t perform that action at this time.
0 commit comments