Files
freeCodeCamp/common/app/routes/challenges/index.js
2016-07-28 23:39:17 -07:00

19 lines
415 B
JavaScript

import Challenges from './components/Challenges.jsx';
import ShowMap from './components/map/Show.jsx';
export const challenges = {
path: 'challenges(/:dashedName)',
component: Challenges,
onEnter(nextState, replace) {
// redirect /challenges to /map
if (nextState.location.pathname === '/challenges') {
replace('/map');
}
}
};
export const map = {
path: 'map',
component: ShowMap
};