componentWillReceiveProps fixes, fixes #184, #231, !80

This commit is contained in:
Alex Gleason
2020-07-04 18:41:41 -05:00
parent 75ab969051
commit 853dad032c
25 changed files with 119 additions and 120 deletions

View File

@@ -42,9 +42,9 @@ export default class ImageLoader extends React.PureComponent {
this.loadImage(this.props);
}
componentDidUpdate(nextProps) {
if (this.props.src !== nextProps.src) {
this.loadImage(nextProps);
componentDidUpdate(prevProps) {
if (prevProps.src !== this.props.src) {
this.loadImage(this.props);
}
}