diff --git a/react.md b/react.md index 62637c720..1d1034575 100644 --- a/react.md +++ b/react.md @@ -63,17 +63,16 @@ render: function () { ``` ### Setting defaults +Pre-populates `this.state.comments` and `this.props.name`. ```js React.createClass({ - // Pre-populates `this.state.data` getInitialState: function () { - return {data: []}; + return { comments: [] }; }, - // Pre-populates `this.props.name` getDefaultProps: function () { - return {name: ''}; + return { name: "Hello" }; } ); ```