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
commit 71673f3466
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>
);
};