From c9ec4bc4459b5f0cd8ca6f1ef5c5b1b27948fe98 Mon Sep 17 00:00:00 2001 From: Kateryna Date: Tue, 4 Oct 2016 20:43:49 +0300 Subject: [PATCH] Fix initial state example for Recat.createClass (#7867) In the example there was a typo with setting initial state using `getInitialState` method --- docs/docs/05-reusable-components.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/05-reusable-components.md b/docs/docs/05-reusable-components.md index a427fa4845c41..118dafe8d81f4 100644 --- a/docs/docs/05-reusable-components.md +++ b/docs/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}; }, // ... });