Skip to content

Commit

Permalink
Replace Object.keys with Object.entries (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonAlling authored and Andres Martinez Gotor committed Oct 23, 2019
1 parent e760e7d commit 16b04b9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions dashboard/src/containers/RoutesContainer/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,11 @@ class Routes extends React.Component<IRoutesProps> {
return (
<Switch>
<Route exact={true} path="/" render={this.rootNamespacedRedirect} />
{Object.keys(routes).map(route => (
<Route key={route} exact={true} path={route} component={routes[route]} />
{Object.entries(routes).map(([route, component]) => (
<Route key={route} exact={true} path={route} component={component} />
))}
{Object.keys(privateRoutes).map(route => (
<PrivateRouteContainer
key={route}
exact={true}
path={route}
component={privateRoutes[route]}
/>
{Object.entries(privateRoutes).map(([route, component]) => (
<PrivateRouteContainer key={route} exact={true} path={route} component={component} />
))}
{/* If the route doesn't match any expected path redirect to a 404 page */}
<Route component={NotFound} />
Expand Down

0 comments on commit 16b04b9

Please sign in to comment.