We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
nativeEvent
1 parent 059ab04 commit 4e6dacaCopy full SHA for 4e6daca
packages/react-native-web/src/modules/ImageLoader/index.js
@@ -122,9 +122,17 @@ const ImageLoader = {
122
id += 1;
123
const image = new window.Image();
124
image.onerror = onError;
125
- image.onload = (e) => {
+ image.onload = (nativeEvent) => {
126
// avoid blocking the main thread
127
- const onDecode = () => onLoad({ nativeEvent: e });
+ const onDecode = () => {
128
+ nativeEvent.source = {
129
+ uri: image.src,
130
+ width: image.naturalWidth,
131
+ height: image.naturalHeight
132
+ };
133
+
134
+ onLoad({ nativeEvent });
135
136
if (typeof image.decode === 'function') {
137
// Safari currently throws exceptions when decoding svgs.
138
// We want to catch that error and allow the load handler
0 commit comments