Fix initial state example for Recat.createClass (#7867)
In the example there was a typo with setting initial state using `getInitialState` method
Kateryna committed
Oct 4, 2016 at 20:43 UTC
c9ec4bc4459b5f0cd8ca6f1ef5c5b1b27948fe98
1 file changed
+1
-1
docs/docs/05-reusable-components.md
+1
-1
@@ -324,7 +324,7 @@ With `React.createClass()`, you have to provide a separate `getInitialState` met
324
```javascript
325
var Counter = React.createClass({
326
getInitialState: function() {
327
- return {count: props.initialCount};
327
+ return {count: this.props.initialCount};
328
},
329
// ...
330
});