fix: error boundary with key

This commit is contained in:
GyDi 2023-06-30 09:17:59 +08:00
parent 955ac92043
commit 3e4084d99c

View File

@ -125,13 +125,19 @@ const Layout = () => {
)} )}
<div className="the-content"> <div className="the-content">
<BaseErrorBoundary> <Routes>
<Routes> {routers.map(({ label, link, ele: Ele }) => (
{routers.map(({ label, link, ele: Ele }) => ( <Route
<Route key={label} path={link} element={<Ele />} /> key={label}
))} path={link}
</Routes> element={
</BaseErrorBoundary> <BaseErrorBoundary key={label}>
<Ele />
</BaseErrorBoundary>
}
/>
))}
</Routes>
</div> </div>
</div> </div>
</Paper> </Paper>