Skip to content

Commit

Permalink
fix(route): add key to top level routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ephys committed Jan 4, 2019
1 parent 61d0860 commit 2d7e693
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/framework/common/router/create-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { getDefault } from '../../../shared/util/ModuleUtil';
import logger from '../../../shared/logger';
import routeModules from 'val-loader!./_find-routes';

// TODO: expose @withQueryParams which provides an URLSearchParam instance

const SourceFileName = Symbol('sourceFileName');

export default function createRoutes() {
Expand Down Expand Up @@ -48,7 +50,7 @@ export default function createRoutes() {
.map(route => sanitizeRoute(route, route[SourceFileName]));
}

function sanitizeRoute(routeData, fileName) {
function sanitizeRoute(routeData /* , fileName */) {

delete routeData.priority;

Expand All @@ -58,5 +60,5 @@ function sanitizeRoute(routeData, fileName) {
// const { getComponent, status, ...passDownRoute } = routeData;
// let routeElement = <Route {...passDownRoute} />;

return <Route {...routeData} />;
return <Route {...routeData} key={routeData.path} />;
}

0 comments on commit 2d7e693

Please sign in to comment.