mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Fix initial state example for Recat.createClass (#7867)
In the example there was a typo with setting initial state using `getInitialState` method
This commit is contained in:
1 parent
30067fa8ca
commit
c9ec4bc445
1 file changed
+1
-1
@@ -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};
|
||||
},
|
||||
// ...
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user