Skip to content

Instantly share code, notes, and snippets.

@wearethefoos
Created April 28, 2016 13:17
Show Gist options
  • Select an option

  • Save wearethefoos/8665d5a3a48bfed0c9cab0417cecc2e5 to your computer and use it in GitHub Desktop.

Select an option

Save wearethefoos/8665d5a3a48bfed0c9cab0417cecc2e5 to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, Link, browserHistory } from 'react-router';
import App from './App';
import Categories from './Categories';
import Category from './Category';
import Games from './Games';
import Game from './Game';
import PageNotFound from './PageNotFound';
ReactDOM.render((
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Categories} />
<Route path="/category/:categoryId" component={Category}>
<IndexRoute component={Games} />
<Route path="/games/:gameId" component={Game}/>
</Route>
<Route path="*" component={PageNotFound}/>
</Route>
</Router>
), document.getElementById('root'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment