UNPKG

668 BJavaScriptView Raw
1import React from 'react';
2import ReactDOM from 'react-dom';
3
4import { AppContainer } from 'react-hot-loader';
5// import walkMD from './walkmd';
6// AppContainer is a necessary wrapper component for HMR
7
8import App from './App';
9
10const 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
23render(App);
24
25
26// Hot Module Replacement API
27if (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