Browse Source

Fix initial state example for Recat.createClass (#7867)

In the example there was a typo with setting initial state using `getInitialState` method
main
Kateryna 8 years ago
committed by Dan Abramov
parent
commit
976ca17896
  1. 2
      docs/05-reusable-components.md

2
docs/05-reusable-components.md

@ -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};
},
// ...
});

Loading…
Cancel
Save