Created
July 7, 2016 21:00
-
-
Save famulus/eff031a5f439853be490eb1e7ca6e1e8 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, { 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