Last active
June 25, 2017 15:51
-
-
Save gregberge/782d40013bb849e6a917c10dfc253494 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import { BrowserRouter, Route } from 'react-router-dom' | |
import loadable from 'loadable-components' | |
const Home = loadable(() => import('./Home')) | |
const About = loadable(() => import('./About')) | |
const Topics = loadable(() => import('./Topics')) | |
const App = () => | |
<BrowserRouter> | |
<div> | |
<ul> | |
<li><Link to="/">Home</Link></li> | |
<li><Link to="/about">About</Link></li> | |
<li><Link to="/topics">Topics</Link></li> | |
</ul> | |
<hr /> | |
<Route exact path="/" component={Home} /> | |
<Route path="/about" component={About} /> | |
<Route path="/topics" component={Topics} /> | |
</div> | |
</BrowserRouter> | |
ReactDOM.render(<App />, document.getElementById('main')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment