|
|
@ -24,10 +24,10 @@ var Box = React.createClass({ |
|
|
|
this.setState({windowWidth: window.innerWidth}); |
|
|
|
}, |
|
|
|
componentDidMount: function() { |
|
|
|
window.addEventListener("resize", this.handleResize); |
|
|
|
window.addEventListener('resize', this.handleResize); |
|
|
|
}, |
|
|
|
componentWillUnmount: function() { |
|
|
|
window.removeEventListener("resize", this.handleResize); |
|
|
|
window.removeEventListener('resize', this.handleResize); |
|
|
|
}, |
|
|
|
render: function() { |
|
|
|
return <div>Current window width: {this.state.windowWidth}</div>; |
|
|
|