Skip to content

Commit

Permalink
Merge pull request #280 from creative-commoners/pulls/2.0/lifecycle
Browse files Browse the repository at this point in the history
ENH Do not use deprecated lifecycle methods
  • Loading branch information
GuySartorelli authored Mar 30, 2023
2 parents 2e98b60 + 20588d7 commit 1d6e8ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ import url from 'url';
import qs from 'qs';

class HistoryViewerVersionDetail extends PureComponent {
componentWillMount() {
componentDidMount() {
this.toggleToolbarClass(true);
}

/**
* When new props are received (from Redux dispatch events), check whether the preview
* state changes. If so, we want to add or remove the legacy CSS modifier for the CMS
* north toolbar based on whether the view mode is "split" (add) or anything else (remove)
*
* @param {Object} nextProps
*/
componentWillReceiveProps(nextProps) {
if (nextProps.previewState !== this.props.previewState) {
this.toggleToolbarClass(nextProps.previewState === 'split');
}
componentDidUpdate() {
this.toggleToolbarClass(this.props.previewState === 'split');
}

componentWillUnmount() {
Expand Down

0 comments on commit 1d6e8ce

Please sign in to comment.