mirror of
https://github.com/usememos/memos.git
synced 2025-02-15 19:00:46 +01:00
chore: fix suspense wrapper
This commit is contained in:
parent
09c195c752
commit
30dca18b79
13
web/src/layouts/SuspenseWrapper.tsx
Normal file
13
web/src/layouts/SuspenseWrapper.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import { Suspense } from "react";
|
||||
import { Outlet } from "react-router-dom";
|
||||
import Loading from "@/pages/Loading";
|
||||
|
||||
function SuspenseWrapper() {
|
||||
return (
|
||||
<Suspense fallback={<Loading />}>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
||||
export default SuspenseWrapper;
|
@ -1,6 +1,7 @@
|
||||
import { lazy } from "react";
|
||||
import { createBrowserRouter } from "react-router-dom";
|
||||
import App from "@/App";
|
||||
import SuspenseWrapper from "@/layouts/SuspenseWrapper";
|
||||
import { initialGlobalState } from "@/store/module";
|
||||
import AuthStatusProvider from "./AuthStatusProvider";
|
||||
|
||||
@ -36,16 +37,22 @@ const router = createBrowserRouter([
|
||||
loader: () => initialGlobalStateLoader(),
|
||||
children: [
|
||||
{
|
||||
path: "/auth",
|
||||
element: <SignIn />,
|
||||
},
|
||||
{
|
||||
path: "/auth/signup",
|
||||
element: <SignUp />,
|
||||
},
|
||||
{
|
||||
path: "/auth/callback",
|
||||
element: <AuthCallback />,
|
||||
path: "/auth/",
|
||||
element: <SuspenseWrapper />,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
element: <SignIn />,
|
||||
},
|
||||
{
|
||||
path: "signup",
|
||||
element: <SignUp />,
|
||||
},
|
||||
{
|
||||
path: "callback",
|
||||
element: <AuthCallback />,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
|
Loading…
x
Reference in New Issue
Block a user