replace getDerivedStateFromProps with componentDidUpdate
This commit is contained in:
+9
-8
@@ -6286,7 +6286,6 @@ var AvatarUpload = function (_React$Component) {
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
if (this.props.avatar != prevProps.avatar) {
|
||||
console.log("parent changed the avatar", prevProps.avatar, this.props.avatar);
|
||||
this.setState({
|
||||
dataUrl: this.props.avatar
|
||||
});
|
||||
@@ -7927,6 +7926,15 @@ var ErrorPanel = function (_React$PureComponent) {
|
||||
}
|
||||
|
||||
_createClass(ErrorPanel, [{
|
||||
key: "componentDidUpdate",
|
||||
value: function componentDidUpdate(prevProps) {
|
||||
if (prevProps.level !== this.props.level) {
|
||||
this.setState({
|
||||
show: !!this.props.level
|
||||
});
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "hide",
|
||||
value: function hide() {
|
||||
this.setState({
|
||||
@@ -7966,13 +7974,6 @@ var ErrorPanel = function (_React$PureComponent) {
|
||||
onCancel: this.hide
|
||||
})));
|
||||
}
|
||||
}], [{
|
||||
key: "getDerivedStateFromProps",
|
||||
value: function getDerivedStateFromProps(nextProps, prevState) {
|
||||
return {
|
||||
show: !!nextProps.level
|
||||
};
|
||||
}
|
||||
}]);
|
||||
|
||||
return ErrorPanel;
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user