-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (26 loc) · 896 Bytes
/
index.js
File metadata and controls
31 lines (26 loc) · 896 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
import React = require('react');
import Router, {Route, DefaultRoute} = require('react-router');
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 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'));
//});