diff --git a/react.md b/react.md index c38ab9ae3..e2a6d5dbb 100644 --- a/react.md +++ b/react.md @@ -39,22 +39,30 @@ var Info = React.createClass({ ``` ## States & Properties +Use [props](https://facebook.github.io/react/docs/tutorial.html#using-props) (`this.props`) to access parameters passed from the parent. +Use [states](https://facebook.github.io/react/docs/tutorial.html#reactive-state) (`this.state`) to manage dynamic data. +{:.center} ```js -this.setState({ editing: true }); -this.state.editing === true +this.setProps({ fullscreen: true }); +this.setState({ username: 'rstacruz' }); +this.props.fullscreen === true +this.state.username === 'rstacruz' + +this.replaceProps({ ... }); this.replaceState({ ... }); ``` ```js -this.setProps({ fullscreen: true }); -this.props.fullscreen === true - -this.replaceProps({ ... }); +render: function () { + return
...
"; } + ``` ### Lists