Remove all usages of UNSAFE_* React methods (#9583)
This commit is contained in:
parent
38dbe8ed33
commit
590b845f3f
33 changed files with 585 additions and 413 deletions
|
@ -99,7 +99,6 @@ interface IState {
|
|||
isUserProfileReady: boolean;
|
||||
error: Error;
|
||||
menuDisplayed: boolean;
|
||||
widgetPageTitle: string;
|
||||
requiresClient: boolean;
|
||||
}
|
||||
|
||||
|
@ -229,7 +228,6 @@ export default class AppTile extends React.Component<IProps, IState> {
|
|||
isUserProfileReady: OwnProfileStore.instance.isProfileInfoFetched,
|
||||
error: null,
|
||||
menuDisplayed: false,
|
||||
widgetPageTitle: this.props.widgetPageTitle,
|
||||
requiresClient: this.determineInitialRequiresClientState(),
|
||||
};
|
||||
}
|
||||
|
@ -351,21 +349,13 @@ export default class AppTile extends React.Component<IProps, IState> {
|
|||
}
|
||||
};
|
||||
|
||||
// TODO: [REACT-WARNING] Replace with appropriate lifecycle event
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
public UNSAFE_componentWillReceiveProps(nextProps: IProps): void { // eslint-disable-line camelcase
|
||||
if (nextProps.app.url !== this.props.app.url) {
|
||||
this.getNewState(nextProps);
|
||||
public componentDidUpdate(prevProps: IProps): void {
|
||||
if (prevProps.app.url !== this.props.app.url) {
|
||||
this.getNewState(this.props);
|
||||
if (this.state.hasPermissionToLoad) {
|
||||
this.resetWidget(nextProps);
|
||||
this.resetWidget(this.props);
|
||||
}
|
||||
}
|
||||
|
||||
if (nextProps.widgetPageTitle !== this.props.widgetPageTitle) {
|
||||
this.setState({
|
||||
widgetPageTitle: nextProps.widgetPageTitle,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -474,8 +464,8 @@ export default class AppTile extends React.Component<IProps, IState> {
|
|||
const name = this.formatAppTileName();
|
||||
const titleSpacer = <span> - </span>;
|
||||
let title = '';
|
||||
if (this.state.widgetPageTitle && this.state.widgetPageTitle !== this.formatAppTileName()) {
|
||||
title = this.state.widgetPageTitle;
|
||||
if (this.props.widgetPageTitle && this.props.widgetPageTitle !== this.formatAppTileName()) {
|
||||
title = this.props.widgetPageTitle;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue