Skip to content

Instantly share code, notes, and snippets.

@famulus
Created July 7, 2016 21:00
Show Gist options
  • Select an option

  • Save famulus/eff031a5f439853be490eb1e7ca6e1e8 to your computer and use it in GitHub Desktop.

Select an option

Save famulus/eff031a5f439853be490eb1e7ca6e1e8 to your computer and use it in GitHub Desktop.
import React, { PropTypes } from 'react';
import { Router } from 'react-router';
class App extends React.Component {
static contextTypes = {
router: PropTypes.object
}
static propTypes = {
history: PropTypes.object.isRequired,
routes: PropTypes.element.isRequired
};
get content() {
return (
<Router
routes={this.props.routes}
history={this.props.history} />
)
}
render () {
return (
<div style={{ height: '100%' }}>
{this.content}
</div>
)
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment