Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
30dca18b
Commit
30dca18b
authored
Dec 28, 2023
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix suspense wrapper
parent
09c195c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
10 deletions
+30
-10
SuspenseWrapper.tsx
web/src/layouts/SuspenseWrapper.tsx
+13
-0
index.tsx
web/src/router/index.tsx
+17
-10
No files found.
web/src/layouts/SuspenseWrapper.tsx
0 → 100644
View file @
30dca18b
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
;
web/src/router/index.tsx
View file @
30dca18b
import
{
lazy
}
from
"react"
;
import
{
lazy
}
from
"react"
;
import
{
createBrowserRouter
}
from
"react-router-dom"
;
import
{
createBrowserRouter
}
from
"react-router-dom"
;
import
App
from
"@/App"
;
import
App
from
"@/App"
;
import
SuspenseWrapper
from
"@/layouts/SuspenseWrapper"
;
import
{
initialGlobalState
}
from
"@/store/module"
;
import
{
initialGlobalState
}
from
"@/store/module"
;
import
AuthStatusProvider
from
"./AuthStatusProvider"
;
import
AuthStatusProvider
from
"./AuthStatusProvider"
;
...
@@ -36,16 +37,22 @@ const router = createBrowserRouter([
...
@@ -36,16 +37,22 @@ const router = createBrowserRouter([
loader
:
()
=>
initialGlobalStateLoader
(),
loader
:
()
=>
initialGlobalStateLoader
(),
children
:
[
children
:
[
{
{
path
:
"/auth"
,
path
:
"/auth/"
,
element
:
<
SignIn
/>,
element
:
<
SuspenseWrapper
/>,
},
children
:
[
{
{
path
:
"/auth/signup"
,
path
:
""
,
element
:
<
SignUp
/>,
element
:
<
SignIn
/>,
},
},
{
{
path
:
"/auth/callback"
,
path
:
"signup"
,
element
:
<
AuthCallback
/>,
element
:
<
SignUp
/>,
},
{
path
:
"callback"
,
element
:
<
AuthCallback
/>,
},
],
},
},
{
{
path
:
"/"
,
path
:
"/"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment