mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Fix create-react-class regression.
Can't call setState in c'tor
This commit is contained in:
parent
ddba5c6223
commit
99cd2dceec
1 changed files with 5 additions and 2 deletions
|
@ -57,11 +57,14 @@ export default class PowerSelector extends React.Component {
|
|||
customValue: this.props.value,
|
||||
selectValue: 0,
|
||||
};
|
||||
|
||||
this._initStateFromProps(this.props);
|
||||
}
|
||||
|
||||
// TODO: [REACT-WARNING] Replace with appropriate lifecycle event
|
||||
// eslint-disable-next-line camelcase
|
||||
UNSAFE_componentWillMount() {
|
||||
this._initStateFromProps(this.props);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
UNSAFE_componentWillReceiveProps(newProps) {
|
||||
this._initStateFromProps(newProps);
|
||||
|
|
Loading…
Reference in a new issue