Permalink
Browse files

Remove the onerror listener in callback.

Prevents recursive calls caused by setting this.img.src to a falsey value. eg. an empty string
  • Loading branch information...
1 parent e0e0c76 commit 4b8a53cd2a7a2345102317b8a8e1e5098cccc820 @joshgillies joshgillies committed Aug 30, 2016
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/blur.jsx
View
@@ -77,7 +77,8 @@ export default class ReactBlur extends React.Component {
props.onLoadFunction(event);
};
this.img.onerror = (event) => {
- this.img.src = '';
+ this.img.onerror = undefined; // Remove the onerror listener. Preventing recursive calls caused by setting this.img.src to a falsey value
+ this.img.src = '';
props.onLoadFunction(event);
};
this.img.src = props.img;

0 comments on commit 4b8a53c

Please sign in to comment.