Add key prop to routes

This commit is contained in:
Jan Tuomi
2019-01-15 12:25:27 +02:00
parent a2680f8626
commit 843544d65d
+2 -2
View File
@@ -44,8 +44,8 @@ const Routes = () => (
"url": "https://sik.ayy.fi",
}} />
<Switch>
{ commonRoutes.map(r => <Route exact path={r.path} render={renderPage(r.page) }/>) }
{ adminRoutes.map(r => <Route exact path={r.path} render={renderAdminPage(r.page) }/>) }
{ commonRoutes.map(r => <Route key={r.path} exact path={r.path} render={renderPage(r.page) }/>) }
{ adminRoutes.map(r => <Route key={r.path} exact path={r.path} render={renderAdminPage(r.page) }/>) }
<Route component={NotFoundPage} />
</Switch>
</Fragment>