fix: error boundary with key

This commit is contained in:
GyDi 2023-06-30 09:17:59 +08:00
parent 97be28638b
commit 3557a77645
No known key found for this signature in database
GPG Key ID: 9C3AD40F1F99880A

View File

@ -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>