Skip to content

Commit

Permalink
refactor: rename legacy lifecycle with UNSAFE prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoyadmoon committed Jun 2, 2023
1 parent b57ae00 commit 4bad64a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/EditableBasicRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class EditableBasicRow extends PureComponent {
};

// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {

Check failure on line 97 in packages/core/src/EditableBasicRow.js

View workflow job for this annotation

GitHub Actions / Lint and test

Identifier 'UNSAFE_componentWillReceiveProps' is not in camel case
if (nextProps.value !== this.props.value) {

Check warning on line 98 in packages/core/src/EditableBasicRow.js

View workflow job for this annotation

GitHub Actions / Lint and test

Must use destructuring props assignment
this.setState({ currentValue: nextProps.value });
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/EditableTextLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class EditableTextLabel extends PureComponent {
};

// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {

Check failure on line 67 in packages/core/src/EditableTextLabel.js

View workflow job for this annotation

GitHub Actions / Lint and test

Identifier 'UNSAFE_componentWillReceiveProps' is not in camel case

Check failure on line 67 in packages/core/src/EditableTextLabel.js

View workflow job for this annotation

GitHub Actions / Lint and test

UNSAFE_componentWillReceiveProps should be placed after resetDblTouchSimulation
/**
* If the edit-state of <EditableTextLabel> is *controlled* by `inEdit` prop.
* If the prop is `undefined`, this component became *uncontrolled*
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/StatusIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ class StatusIcon extends PureComponent {
};

// eslint-disable-next-line react/no-deprecated
componentWillMount() {
UNSAFE_componentWillMount() {

Check failure on line 52 in packages/core/src/StatusIcon.js

View workflow job for this annotation

GitHub Actions / Lint and test

Identifier 'UNSAFE_componentWillMount' is not in camel case

Check failure on line 52 in packages/core/src/StatusIcon.js

View workflow job for this annotation

GitHub Actions / Lint and test

UNSAFE_componentWillMount should be placed after componentWillUnmount
this.autoToggleStatusIcon();
}

// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {

Check failure on line 57 in packages/core/src/StatusIcon.js

View workflow job for this annotation

GitHub Actions / Lint and test

Identifier 'UNSAFE_componentWillReceiveProps' is not in camel case
if (nextProps.status !== this.props.status) {

Check warning on line 58 in packages/core/src/StatusIcon.js

View workflow job for this annotation

GitHub Actions / Lint and test

Must use destructuring props assignment
this.autoToggleStatusIcon(nextProps.status);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/SelectList.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SelectList extends PureComponent {
};

// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {

Check failure on line 76 in packages/form/src/SelectList.js

View workflow job for this annotation

GitHub Actions / Lint and test

Identifier 'UNSAFE_componentWillReceiveProps' is not in camel case

Check failure on line 76 in packages/form/src/SelectList.js

View workflow job for this annotation

GitHub Actions / Lint and test

UNSAFE_componentWillReceiveProps should be placed after getValues
warning(
this.getIsControlled(this.props) === this.getIsControlled(nextProps),
'<SelectList> should not switch from controlled to uncontrolled (or vice versa).'
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/SelectRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class SelectRow extends PureComponent {
};

// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {

Check failure on line 104 in packages/form/src/SelectRow.js

View workflow job for this annotation

GitHub Actions / Lint and test

Identifier 'UNSAFE_componentWillReceiveProps' is not in camel case

Check failure on line 104 in packages/form/src/SelectRow.js

View workflow job for this annotation

GitHub Actions / Lint and test

UNSAFE_componentWillReceiveProps should be placed after getCacheValueArray
this.setState({
valueLabelMap: getValueToLabelAvatarMap(nextProps.children),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/form/src/SwitchRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SwitchRow extends PureComponent {
};

// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.setState({ checked: nextProps.checked });
}

Expand Down
2 changes: 1 addition & 1 deletion packages/imageeditor/src/ImageEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ImageEditor extends PureComponent {
editorRef = React.createRef();

// eslint-disable-next-line react/no-deprecated
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// Consider current `scale`, `position` and `initCropRect` outdated when image changes
if (nextProps.image !== this.props.image) {
this.setState({
Expand Down

0 comments on commit 4bad64a

Please sign in to comment.