Created
March 2, 2016 10:23
-
-
Save thomasfl/0f79978a3349e8ba5a34 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, { ReactDOM, Component, PropTypes } from 'react'; | |
import {render} from 'react-dom'; | |
import { Router, Route, Link, browserHistory} from 'react-router' | |
/** React router hello world example **/ | |
class App extends Component { | |
render() { | |
return ( | |
<div> | |
<h1>App component</h1> | |
<Link to="/">Hjem</Link> | |
<br/> | |
<Link to="about">About</Link> | |
{this.props.children} | |
</div> | |
) | |
} | |
} | |
class About extends Component { | |
render() { | |
return ( | |
<div> | |
<h1>Kitchen sink component</h1> | |
</div> | |
) | |
} | |
} | |
render(( | |
<Router history={browserHistory}> | |
<Route path="/" component={App}> | |
<Route path="about" component={About}/> | |
</Route> | |
</Router> | |
), document.getElementById('app') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment