1 | import React from 'react';
|
2 | import ReactDOM from 'react-dom';
|
3 |
|
4 | import {Router, Route, Link, browserHistory, hashHistory, IndexRoute} from 'react-router';
|
5 |
|
6 |
|
7 | import { AppContainer } from 'react-hot-loader';
|
8 |
|
9 |
|
10 |
|
11 | import App from './App';
|
12 |
|
13 | const render = (Component) => {
|
14 | ReactDOM.render(
|
15 | <Router history={hashHistory}>
|
16 | <Route path="/" component={Index}>
|
17 | <IndexRoute component={App}/>
|
18 | </Route>
|
19 |
|
20 |
|
21 | </Router>,
|
22 | document.getElementById('root')
|
23 | );
|
24 | };
|
25 |
|
26 | render(App);
|
27 |
|
28 |
|
29 |
|
30 | if (module.hot) {
|
31 | console.log('module.hot:', module.hot)
|
32 | module.hot.accept('./App', () => {
|
33 | render(App)
|
34 | });
|
35 | } |
\ | No newline at end of file |