Skip to content

Commit

Permalink
fix: fix plugin root route path incorrect problem
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Aug 7, 2023
1 parent bea1170 commit 588fae2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions client/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,15 @@ export const App: React.FC = React.memo(() => {
path="/plugin/*"
element={
<FallbackPortalHost>
{pluginRootRoute.map((r, i) => (
// NOTICE: Switch里不能出现动态路由
<Route
key={r.name}
path={
r.path ? `/plugin${r.path}` : `/plugin/fallback${i}`
}
element={React.createElement(r.component)}
/>
))}
<Routes>
{pluginRootRoute.map((r, i) => (
<Route
key={r.name}
path={r.path ?? `/fallback${i}`}
element={React.createElement(r.component)}
/>
))}
</Routes>
</FallbackPortalHost>
}
/>
Expand Down

0 comments on commit 588fae2

Please sign in to comment.