UNPKG

803 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
7import {
8 BrowserRouter as Router,
9 Route,
10 Link
11} from 'react-router-dom';
12
13import App from './App';
14
15
16const About = () => {
17 return (
18 <div>about</div>
19 )
20}
21
22const Topics = () => {
23 return (
24 <div>Topics</div>
25 )
26}
27
28const render = (Component) => {
29 ReactDOM.render(
30 <Router>
31
32 <Route path="/about" component={About}/>
33 <Route path="/topics" component={Topics}/>
34 </Router>
35 ,
36 document.getElementById('root')
37 );
38};
39
40render(App);
41
42
43// Hot Module Replacement API
44// if (module.hot) {
45// module.hot.accept('./App', () => {
46// render(App)
47// });
48// }
\No newline at end of file