0
Fork 0
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:
Gao Sun 2023-04-22 22:24:06 +08:00 committed by GitHub
parent b204cf828d
commit 5ef299866d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,3 +1,4 @@
import { useMemo } from 'react';
import {
Route,
RouterProvider,
@ -19,18 +20,22 @@ import HandleSocialCallback from '../Profile/containers/HandleSocialCallback';
function Main() {
const swrOptions = useSwrOptions();
const router = createBrowserRouter(
createRoutesFromElements(
<>
<Route path="callback" element={<Callback />} />
<Route path="welcome" element={<Welcome />} />
<Route path="handle-social" element={<HandleSocialCallback />} />
<Route element={<AppContent />}>
<Route path="/*" element={<ConsoleContent />} />
</Route>
</>
),
{ basename: getBasename() }
const router = useMemo(
() =>
createBrowserRouter(
createRoutesFromElements(
<>
<Route path="callback" element={<Callback />} />
<Route path="welcome" element={<Welcome />} />
<Route path="handle-social" element={<HandleSocialCallback />} />
<Route element={<AppContent />}>
<Route path="/*" element={<ConsoleContent />} />
</Route>
</>
),
{ basename: getBasename() }
),
[]
);
return (