mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Remove React warning
Fire onOptionChange in componentWillMount, otherwise end up trying to update state effectively in a render method, which is bad.
This commit is contained in:
parent
6f4b080934
commit
e139f5212a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user