Browse Source

fix 2 more entries

main
Cheng Lou 11 years ago
parent
commit
4e3dd23316
  1. 4
      cookbook/11-dom-event-listeners.md
  2. 3
      cookbook/12-initial-ajax.md

4
cookbook/11-dom-event-listeners.md

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

3
cookbook/12-initial-ajax.md

@ -41,6 +41,7 @@ var UserGist = React.createClass({
}); });
React.renderComponent( React.renderComponent(
<UserGist source="https://api.github.com/users/octocat/gists" />, mountNode <UserGist source="https://api.github.com/users/octocat/gists" />,
mountNode
); );
``` ```

Loading…
Cancel
Save