Skip to content

Commit

Permalink
Fix initial state example for Recat.createClass (#7867)
Browse files Browse the repository at this point in the history
In the example there was a typo with setting initial state using `getInitialState` method
  • Loading branch information
krambertech authored and gaearon committed Oct 4, 2016
1 parent 30067fa commit c9ec4bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/05-reusable-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ With `React.createClass()`, you have to provide a separate `getInitialState` met
```javascript
var Counter = React.createClass({
getInitialState: function() {
return {count: props.initialCount};
return {count: this.props.initialCount};
},
// ...
});
Expand Down

0 comments on commit c9ec4bc

Please sign in to comment.