fix: place app routes inside router context
This commit is contained in:
1 parent
38bcbfc697
commit
655783b724
1 file changed
+2
-2
@@ -66,7 +66,6 @@ function AppRoutes() {
|
|||||||
const { brand } = useBrand()
|
const { brand } = useBrand()
|
||||||
useEffect(() => { document.title = brand.brand_name }, [brand.brand_name])
|
useEffect(() => { document.title = brand.brand_name }, [brand.brand_name])
|
||||||
return (
|
return (
|
||||||
<BrowserRouter>
|
|
||||||
<PageErrorBoundary>
|
<PageErrorBoundary>
|
||||||
<Suspense fallback={<div className="route-loading" role="status" aria-label="页面加载中"><span /></div>}>
|
<Suspense fallback={<div className="route-loading" role="status" aria-label="页面加载中"><span /></div>}>
|
||||||
<Routes>
|
<Routes>
|
||||||
@@ -89,7 +88,6 @@ function AppRoutes() {
|
|||||||
</Routes>
|
</Routes>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</PageErrorBoundary>
|
</PageErrorBoundary>
|
||||||
</BrowserRouter>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +95,9 @@ export default function App() {
|
|||||||
return (
|
return (
|
||||||
<ConfigProvider theme={theme} locale={zhCN}>
|
<ConfigProvider theme={theme} locale={zhCN}>
|
||||||
<BrandProvider>
|
<BrandProvider>
|
||||||
|
<BrowserRouter>
|
||||||
<AppRoutes />
|
<AppRoutes />
|
||||||
|
</BrowserRouter>
|
||||||
</BrandProvider>
|
</BrandProvider>
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user