Merge pull request #780 from matrix-org/dbkr/country_dropdown_setstate_warning

Remove React warning
This commit is contained in:
David Baker 2017-03-29 15:20:27 +01:00 committed by GitHub
commit 27c945c544

View file

@ -43,8 +43,10 @@ export default class CountryDropdown extends React.Component {
this.state = {
searchQuery: '',
}
}
if (!props.value) {
componentWillMount() {
if (!this.props.value) {
// If no value is given, we start with the first
// country selected, but our parent component
// doesn't know this, therefore we do this.