Skip to content

Commit 26340b6

Browse files
committed
Support PUBLIC_URL
Set the `BrowserRouter`'s `basename` as the `PUBLIC_URL` so that `PUBLIC_URL` becomes the root path for LiT and the rest or the relative routing works wrt it.
1 parent e47dc47 commit 26340b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/AppRoutes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Suspense } from 'react';
22
import { BrowserRouter, Route, Routes } from 'react-router-dom';
33
import Loading from 'components/common/Loading';
44
import { Layout } from 'components/layout';
5+
import { PUBLIC_URL } from 'config';
56

67
const LazyAuthPage = React.lazy(() => import('components/auth/AuthPage'));
78
const LazyLoopPage = React.lazy(() => import('components/loop/LoopPage'));
@@ -13,7 +14,7 @@ const LazyConnectPage = React.lazy(() => import('components/connect/ConnectPage'
1314
const AppRoutes: React.FC = () => {
1415
return (
1516
<Suspense fallback={<Loading delay={500} />}>
16-
<BrowserRouter>
17+
<BrowserRouter basename={PUBLIC_URL}>
1718
<Routes>
1819
<Route path="/" element={<LazyAuthPage />} />
1920
<Route>

0 commit comments

Comments
 (0)