Skip to content

Commit

Permalink
fix(places/SearchBox): use setState in lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed Sep 16, 2017
1 parent fb6658e commit 671089b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/macros/places/SearchBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class SearchBox extends React.PureComponent {
}

componentWillMount() {
if (!canUseDOM || this.state[SEARCH_BOX]) {
if (!canUseDOM || this.containerElement) {
return
}
this.containerElement = document.createElement(`div`)
Expand All @@ -51,9 +51,9 @@ export class SearchBox extends React.PureComponent {
this.containerElement.firstChild
)
construct(SearchBox.propTypes, updaterMap, this.props, searchBox)
this.state = {
this.setState({
[SEARCH_BOX]: searchBox,
}
})
}

componentDidMount() {
Expand Down

0 comments on commit 671089b

Please sign in to comment.