UNPKG

754 BJavaScriptView Raw
1import React from 'react';
2import ReactDOM from 'react-dom';
3
4import {Router, Route, Link, browserHistory, hashHistory, IndexRoute} from 'react-router';
5
6
7import { AppContainer } from 'react-hot-loader';
8// import walkMD from './walkmd';
9// AppContainer is a necessary wrapper component for HMR
10
11import App from './App';
12
13const render = (Component) => {
14 ReactDOM.render(
15 <Router history={hashHistory}>
16 <Route path="/" component={App}>
17 <IndexRoute component={App}/>
18 </Route>
19
20
21 </Router>,
22 document.getElementById('root')
23 );
24};
25
26render(App);
27
28
29// Hot Module Replacement API
30if (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