Last active
January 8, 2017 04:58
-
-
Save morganney/3b8f3e4d9af3bd645f6b3662ccfea5da to your computer and use it in GitHub Desktop.
This file contains 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 Title from './components/title' | |
import GridSizeSelector from './components/grid-size-selector' | |
import GameOfLife from './components/game-of-life' | |
class App extends React.Component { | |
constructor (props) { | |
super(props) | |
this.handleGridSizeChange = this.handleGridSizeChange.bind(this) | |
} | |
handleGridSizeChange (size) { | |
this.refs.gol.handleGridSizeChange(size) | |
} | |
render () { | |
return ( | |
<div> | |
<Title /> | |
<GridSizeSelector onGridSizeChange={this.handleGridSizeChange} /> | |
<GameOfLife ref='gol' /> | |
</div> | |
) | |
} | |
} | |
export default { | |
init (selector) { | |
ReactDOM.render(<App />, document.getElementById(selector)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment