Skip to content

Commit

Permalink
Merge pull request #6913 from zxl634/patch-1
Browse files Browse the repository at this point in the history
Do not suggest to call setState in constructor
  • Loading branch information
ndelangen authored and shilman committed Jun 5, 2019
1 parent 006615a commit d477111
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/src/pages/basics/faq/index.md
Expand Up @@ -48,10 +48,11 @@ import { storiesOf } from '@storybook/react';
class MyComponent extends Component {
constructor(props) {
super(props)
this.setState({

this.state = {
someVar: 'defaultValue',
...props.initialState
})
}
}
// ...
}
Expand Down

0 comments on commit d477111

Please sign in to comment.