Skip to content

Commit

Permalink
fix: error boundary with key
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Jun 30, 2023
1 parent 97be286 commit 3557a77
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/pages/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,19 @@ const Layout = () => {
)}

<div className="the-content">
<BaseErrorBoundary>
<Routes>
{routers.map(({ label, link, ele: Ele }) => (
<Route key={label} path={link} element={<Ele />} />
))}
</Routes>
</BaseErrorBoundary>
<Routes>
{routers.map(({ label, link, ele: Ele }) => (
<Route
key={label}
path={link}
element={
<BaseErrorBoundary key={label}>
<Ele />
</BaseErrorBoundary>
}
/>
))}
</Routes>
</div>
</div>
</Paper>
Expand Down

0 comments on commit 3557a77

Please sign in to comment.