Last active
August 29, 2015 14:24
-
-
Save isnifer/e3209d71d3f31871ff3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'babel/polyfill'; | |
import 'isomorphic-fetch'; | |
import React from 'react'; | |
import Router from 'react-router'; | |
import FluxComponent from 'flummox/component'; | |
import Flux from '../flux'; | |
import routes from './routes'; | |
import '../less/main.less'; | |
import performRouteHandlerStaticMethod from '../flux/performRouteHandlerStaticMethod'; | |
var flux = new Flux(); | |
var router = Router.create({ | |
routes: routes, | |
location: Router.HistoryLocation | |
}); | |
var mountNode = document.getElementById('main'); | |
router.run(async (Handler, state) => { | |
const routeHandlerInfo = { state, flux }; | |
performRouteHandlerStaticMethod(state.routes, 'routerWillRun', routeHandlerInfo).then(function (data) { | |
React.render( | |
<FluxComponent flux={flux}> | |
<Handler {...state} /> | |
</FluxComponent>, | |
mountNode | |
); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Route, DefaultRoute, NotFoundRoute } from 'react-router'; | |
import App from './handlers/App'; | |
import MainPage from './handlers/MainPage'; | |
import MyGames from './handlers/MyGames'; | |
export default ( | |
<Route name="app" path="/react" handler={App}> | |
<DefaultRoute name="main" handler={MainPage} /> | |
<Route name="mygames" path="/react/mygames:type?:status?" handler={MyGames} /> | |
</Route> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment