Skip to content

Commit 69c2023

Browse files
committed
revert
1 parent d1ad391 commit 69c2023

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

dist/index.cjs.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ function (_Component) {
13581358
key: "componentWillUnmount",
13591359
value: function componentWillUnmount() {
13601360
this.unmounted = true;
1361-
} // Load the image to measure its dimensions
1361+
} // Load the background image in memory to measure its dimensions
13621362

13631363
}, {
13641364
key: "getImageDimensionInfo",
@@ -1397,10 +1397,10 @@ function (_Component) {
13971397
var _this$state = this.state,
13981398
naturalHeight = _this$state.naturalHeight,
13991399
naturalWidth = _this$state.naturalWidth;
1400-
return React__default.createElement("img", _extends({
1401-
src: src,
1402-
width: naturalWidth || undefined,
1403-
height: naturalHeight || undefined
1400+
return React__default.createElement("image", _extends({
1401+
href: src,
1402+
width: naturalWidth,
1403+
height: naturalHeight
14041404
}, otherProps));
14051405
}
14061406
}]);

dist/index.esm.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ function (_Component) {
13511351
key: "componentWillUnmount",
13521352
value: function componentWillUnmount() {
13531353
this.unmounted = true;
1354-
} // Load the image to measure its dimensions
1354+
} // Load the background image in memory to measure its dimensions
13551355

13561356
}, {
13571357
key: "getImageDimensionInfo",
@@ -1390,10 +1390,10 @@ function (_Component) {
13901390
var _this$state = this.state,
13911391
naturalHeight = _this$state.naturalHeight,
13921392
naturalWidth = _this$state.naturalWidth;
1393-
return React.createElement("img", _extends({
1394-
src: src,
1395-
width: naturalWidth || undefined,
1396-
height: naturalHeight || undefined
1393+
return React.createElement("image", _extends({
1394+
href: src,
1395+
width: naturalWidth,
1396+
height: naturalHeight
13971397
}, otherProps));
13981398
}
13991399
}]);

src/ImageLayer.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ImageLayer extends Component {
2727
this.unmounted = true;
2828
}
2929

30-
// Load the image to measure its dimensions
30+
// Load the background image in memory to measure its dimensions
3131
getImageDimensionInfo() {
3232
const { src: initialSrc } = this.props;
3333
const memoryImage = new Image();
@@ -41,7 +41,6 @@ class ImageLayer extends Component {
4141
naturalWidth: memoryImage.naturalWidth,
4242
naturalHeight: memoryImage.naturalHeight,
4343
});
44-
4544
this.props.onLoad({
4645
naturalWidth: memoryImage.naturalWidth,
4746
naturalHeight: memoryImage.naturalHeight,
@@ -55,11 +54,10 @@ class ImageLayer extends Component {
5554
const { naturalHeight, naturalWidth } = this.state;
5655

5756
return (
58-
<img
59-
src={src}
60-
alt=""
61-
width={naturalWidth || undefined}
62-
height={naturalHeight || undefined}
57+
<image
58+
href={src}
59+
width={naturalWidth}
60+
height={naturalHeight}
6361
{...otherProps}
6462
/>
6563
);
@@ -75,4 +73,4 @@ ImageLayer.defaultProps = {
7573
onLoad: () => {},
7674
};
7775

78-
export default ImageLayer;
76+
export default ImageLayer;

0 commit comments

Comments
 (0)