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