Skip to content

Instantly share code, notes, and snippets.

@thomasfl
Created March 2, 2016 10:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save thomasfl/0f79978a3349e8ba5a34 to your computer and use it in GitHub Desktop.
Save thomasfl/0f79978a3349e8ba5a34 to your computer and use it in GitHub Desktop.
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