Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Drop workaround for object.onLoad
Browse files Browse the repository at this point in the history
facebook/react#5781 has been fixed in React 15.0, so
drop our workaroud for it.
  • Loading branch information
richvdh committed Apr 17, 2016
1 parent 3cde221 commit 716eb1e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/components/views/elements/TintableSvg.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,10 @@ var TintableSvg = React.createClass({
componentDidMount: function() {
this.id = TintableSvg.idSequence++;
TintableSvg.mounts[this.id] = this;
// we can't use onLoad on object due to https://github.com/facebook/react/pull/5781
// so handle it with pure DOM instead
ReactDOM.findDOMNode(this).addEventListener('load', this.onLoad);
},

componentWillUnmount: function() {
delete TintableSvg.mounts[this.id];
ReactDOM.findDOMNode(this).removeEventListener('load', this.onLoad);
},

tint: function() {
Expand All @@ -71,9 +67,11 @@ var TintableSvg = React.createClass({
type="image/svg+xml"
data={ this.props.src }
width={ this.props.width }
height={ this.props.height }/>
height={ this.props.height }
onLoad={ this.onLoad }
/>
);
}
});

module.exports = TintableSvg;
module.exports = TintableSvg;

0 comments on commit 716eb1e

Please sign in to comment.