Merge pull request #10 from lilonghe/patch-1

fix: the page bounce when switching routes
This commit is contained in:
Teng
2023-07-07 21:41:31 +08:00
committed by GitHub

View File

@@ -11,7 +11,7 @@ if (G_ID) {
} }
const App = () => { const App = () => {
const Views = () => useRoutes(routes); const views = useRoutes(routes);
const location = useLocation(); const location = useLocation();
useEffect(() => { useEffect(() => {
@@ -23,7 +23,7 @@ const App = () => {
return ( return (
<Suspense fallback={<LoadingPage />}> <Suspense fallback={<LoadingPage />}>
<Views /> {views}
</Suspense> </Suspense>
); );
}; };