fix: the page bounce when switching routes

This commit is contained in:
longhe.li 2023-07-07 14:46:19 +08:00 committed by GitHub
parent d35fddad01
commit 63219bed2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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>
); );
}; };