Skip to content

Commit

Permalink
fix: Rename componentWill* to UNSAFE_componentWill*
Browse files Browse the repository at this point in the history
In React >=18, only the UNSAFE_ name will work.
The "UNSAFE_componentWill*" methods have been added since React 16.3

(`componentWillUnmount` is not concerned)
  • Loading branch information
Merkur39 committed Sep 27, 2022
1 parent 4ca89de commit 10b5fba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion react/Viewer/ViewersByFile/ImageViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ImageViewer extends Component {
}
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (
nextProps.file &&
this.props.file &&
Expand Down
4 changes: 2 additions & 2 deletions react/Viewer/hoc/withFileUrl.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ const withFileUrl = BaseComponent =>
static contextTypes = {
client: PropTypes.object.isRequired
}
componentWillMount() {
UNSAFE_componentWillMount() {
this.loadDownloadUrl()
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (
nextProps.file.id !== this.props.file.id ||
nextProps.url !== this.props.url
Expand Down

0 comments on commit 10b5fba

Please sign in to comment.