mirror of
https://github.com/logto-io/logto.git
synced 2025-02-17 22:04:19 -05:00
fix(console): fix react data router (#3737)
This commit is contained in:
parent
b204cf828d
commit
5ef299866d
1 changed files with 17 additions and 12 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import { useMemo } from 'react';
|
||||||
import {
|
import {
|
||||||
Route,
|
Route,
|
||||||
RouterProvider,
|
RouterProvider,
|
||||||
|
@ -19,18 +20,22 @@ import HandleSocialCallback from '../Profile/containers/HandleSocialCallback';
|
||||||
|
|
||||||
function Main() {
|
function Main() {
|
||||||
const swrOptions = useSwrOptions();
|
const swrOptions = useSwrOptions();
|
||||||
const router = createBrowserRouter(
|
const router = useMemo(
|
||||||
createRoutesFromElements(
|
() =>
|
||||||
<>
|
createBrowserRouter(
|
||||||
<Route path="callback" element={<Callback />} />
|
createRoutesFromElements(
|
||||||
<Route path="welcome" element={<Welcome />} />
|
<>
|
||||||
<Route path="handle-social" element={<HandleSocialCallback />} />
|
<Route path="callback" element={<Callback />} />
|
||||||
<Route element={<AppContent />}>
|
<Route path="welcome" element={<Welcome />} />
|
||||||
<Route path="/*" element={<ConsoleContent />} />
|
<Route path="handle-social" element={<HandleSocialCallback />} />
|
||||||
</Route>
|
<Route element={<AppContent />}>
|
||||||
</>
|
<Route path="/*" element={<ConsoleContent />} />
|
||||||
),
|
</Route>
|
||||||
{ basename: getBasename() }
|
</>
|
||||||
|
),
|
||||||
|
{ basename: getBasename() }
|
||||||
|
),
|
||||||
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Add table
Reference in a new issue