-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (28 loc) · 942 Bytes
/
index.js
File metadata and controls
34 lines (28 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const React = require('react');
import {mount} from './app/lib/tools';
// For mounting App component into <section id="app"></section> use:
//
// import App from './app/components/App';
// mount(App, 'app');
//
// else
import App from './app/components/App';
import Home from './app/components/Home';
import About from './app/components/About';
const Router = require('react-router');
const Route = Router.Route;
const DefaultRoute = Router.DefaultRoute;
const routes = (
<Route name="app" path="/" handler={App}>
<Route name="home" handler={Home}/>
<Route name="about" handler={About}/>
<DefaultRoute handler={Home}/>
</Route>
);
Router.run(routes, function (Handler) {
React.render(<Handler/>, document.getElementById('app'));
});
// or HTML5 pushstate history:
//Router.run(routes, Router.HistoryLocation, function (Handler) {
// React.render(<Handler/>, document.getElementById('app'));
//});