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