Skip to content

Commit 1d6e8ce

Browse files
Merge pull request #280 from creative-commoners/pulls/2.0/lifecycle
ENH Do not use deprecated lifecycle methods
2 parents 2e98b60 + 20588d7 commit 1d6e8ce

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

client/dist/js/bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/components/HistoryViewer/HistoryViewerVersionDetail.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,17 @@ import url from 'url';
1010
import qs from 'qs';
1111

1212
class HistoryViewerVersionDetail extends PureComponent {
13-
componentWillMount() {
13+
componentDidMount() {
1414
this.toggleToolbarClass(true);
1515
}
1616

1717
/**
1818
* When new props are received (from Redux dispatch events), check whether the preview
1919
* state changes. If so, we want to add or remove the legacy CSS modifier for the CMS
2020
* north toolbar based on whether the view mode is "split" (add) or anything else (remove)
21-
*
22-
* @param {Object} nextProps
2321
*/
24-
componentWillReceiveProps(nextProps) {
25-
if (nextProps.previewState !== this.props.previewState) {
26-
this.toggleToolbarClass(nextProps.previewState === 'split');
27-
}
22+
componentDidUpdate() {
23+
this.toggleToolbarClass(this.props.previewState === 'split');
2824
}
2925

3026
componentWillUnmount() {

0 commit comments

Comments
 (0)