Skip to content

Commit

Permalink
Merge pull request #3 from dgorczyca/master
Browse files Browse the repository at this point in the history
Update component if the source changed
  • Loading branch information
dzmitry-stramavus authored Apr 25, 2019
2 parents c07eb05 + 67c1f49 commit 810fa84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Img extends Component {
}

componentDidUpdate(prevProps) {
if (prevProps.config.innerWidth !== this.props.config.innerWidth)
if (prevProps.config.innerWidth !== this.props.config.innerWidth || this.props.src !== prevProps.src)
this.processImage();
}

Expand Down Expand Up @@ -225,4 +225,4 @@ const styles = {

export default ImgWrapper;

export { CloudimageProvider };
export { CloudimageProvider };

0 comments on commit 810fa84

Please sign in to comment.