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

Commit 716eb1e

Browse files
committed
Drop workaround for object.onLoad
facebook/react#5781 has been fixed in React 15.0, so drop our workaroud for it.
1 parent 3cde221 commit 716eb1e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/views/elements/TintableSvg.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,10 @@ var TintableSvg = React.createClass({
4343
componentDidMount: function() {
4444
this.id = TintableSvg.idSequence++;
4545
TintableSvg.mounts[this.id] = this;
46-
// we can't use onLoad on object due to https://github.com/facebook/react/pull/5781
47-
// so handle it with pure DOM instead
48-
ReactDOM.findDOMNode(this).addEventListener('load', this.onLoad);
4946
},
5047

5148
componentWillUnmount: function() {
5249
delete TintableSvg.mounts[this.id];
53-
ReactDOM.findDOMNode(this).removeEventListener('load', this.onLoad);
5450
},
5551

5652
tint: function() {
@@ -71,9 +67,11 @@ var TintableSvg = React.createClass({
7167
type="image/svg+xml"
7268
data={ this.props.src }
7369
width={ this.props.width }
74-
height={ this.props.height }/>
70+
height={ this.props.height }
71+
onLoad={ this.onLoad }
72+
/>
7573
);
7674
}
7775
});
7876

79-
module.exports = TintableSvg;
77+
module.exports = TintableSvg;

0 commit comments

Comments
 (0)