Skip to content

Commit

Permalink
Merge pull request mosch#317 from florapdx/pr-to-source
Browse files Browse the repository at this point in the history
prevent setState loop when image prop value is null
  • Loading branch information
mosch authored Jan 10, 2020
2 parents 54b7a32 + ebe02be commit b230c95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class AvatarEditor extends React.Component {
this.props.height !== prevProps.height
) {
this.loadImage(this.props.image)
} else if (!this.props.image) {
} else if (!this.props.image && prevState.image !== defaultEmptyImage) {
this.clearImage()
}

Expand Down

0 comments on commit b230c95

Please sign in to comment.