Removing componentWillReceiveProps from base views

This commit is contained in:
James Barnsley
2020-03-11 20:40:20 +13:00
parent b988cf27f8
commit 3e56a3f873
10 changed files with 239 additions and 168 deletions

View File

@ -16,10 +16,9 @@ class QueueHistory extends React.Component {
this.loadHistory();
}
componentWillReceiveProps(nextProps) {
if (!this.props.mopidy_connected && nextProps.mopidy_connected) {
this.loadHistory(nextProps);
}
componentDidUpdate = ({ mopidy_connected: prev_mopidy_connected }) => {
const { mopidy_connected } = this.props;
if (!prev_mopidy_connected && mopidy_connected) this.loadHistory();
}
loadHistory(props = this.props) {