File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Suspense } from 'react'
2
- import { Redirect , Route , Switch } from 'react-router-dom'
2
+ import { Navigate , Route , Routes } from 'react-router-dom'
3
3
import { CContainer , CSpinner } from '@coreui/react'
4
4
5
5
// routes config
@@ -9,7 +9,7 @@ const AppContent = () => {
9
9
return (
10
10
< CContainer lg >
11
11
< Suspense fallback = { < CSpinner color = "primary" /> } >
12
- < Switch >
12
+ < Routes >
13
13
{ routes . map ( ( route , idx ) => {
14
14
return (
15
15
route . component && (
@@ -18,17 +18,13 @@ const AppContent = () => {
18
18
path = { route . path }
19
19
exact = { route . exact }
20
20
name = { route . name }
21
- render = { ( props ) => (
22
- < >
23
- < route . component { ...props } />
24
- </ >
25
- ) }
21
+ element = { < route . component /> }
26
22
/>
27
23
)
28
24
)
29
25
} ) }
30
- < Redirect from = "/" to = "/ dashboard" />
31
- </ Switch >
26
+ < Route path = "/" element = { < Navigate to = "dashboard" replace /> } />
27
+ </ Routes >
32
28
</ Suspense >
33
29
</ CContainer >
34
30
)
You can’t perform that action at this time.
0 commit comments