Merge pull request #4313 from matrix-org/travis/react-warnings/1-componentDidMount
Use componentDidMount in place of componentWillMount where possible
This commit is contained in:
commit
59a99bbad8
70 changed files with 81 additions and 91 deletions
|
@ -55,7 +55,7 @@ export default createReactClass({
|
|||
};
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
componentDidMount: function() {
|
||||
MatrixClientPeg.get().on("RoomState.events", this.onRoomStateEvents);
|
||||
},
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ export default createReactClass({
|
|||
};
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
componentDidMount: function() {
|
||||
this._sessionStore = sessionStore;
|
||||
this._sessionStoreToken = this._sessionStore.addListener(
|
||||
this._setStateFromSessionStore,
|
||||
|
|
|
@ -63,7 +63,7 @@ export default class EventIndexPanel extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
async componentWillMount(): void {
|
||||
async componentDidMount(): void {
|
||||
this.updateState();
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ export default class KeyBackupPanel extends React.PureComponent {
|
|||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
this._checkKeyBackupStatus();
|
||||
|
||||
MatrixClientPeg.get().on('crypto.keyBackupStatus', this._onKeyBackupStatus);
|
||||
|
|
|
@ -87,7 +87,7 @@ export default createReactClass({
|
|||
};
|
||||
},
|
||||
|
||||
componentWillMount: function() {
|
||||
componentDidMount: function() {
|
||||
this._refreshFromServer();
|
||||
},
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ export default class HelpUserSettingsTab extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentWillMount(): void {
|
||||
componentDidMount(): void {
|
||||
PlatformPeg.get().getAppVersion().then((ver) => this.setState({vectorVersion: ver})).catch((e) => {
|
||||
console.error("Error getting vector version: ", e);
|
||||
});
|
||||
|
|
|
@ -81,7 +81,7 @@ export default class PreferencesUserSettingsTab extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
async componentWillMount(): void {
|
||||
async componentDidMount(): void {
|
||||
const platform = PlatformPeg.get();
|
||||
|
||||
const autoLaunchSupported = await platform.supportsAutoLaunch();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue