mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-04 19:05:49 +00:00
committed by
Nicolas Gallagher
parent
8add92f776
commit
c6425a0048
+1
-1
@@ -236,7 +236,7 @@ const Image = forwardRef<ImageProps, *>((props, ref) => {
|
|||||||
function load(e) {
|
function load(e) {
|
||||||
updateState(LOADED);
|
updateState(LOADED);
|
||||||
if (onLoad) {
|
if (onLoad) {
|
||||||
onLoad();
|
onLoad(e);
|
||||||
}
|
}
|
||||||
if (onLoadEnd) {
|
if (onLoadEnd) {
|
||||||
onLoadEnd();
|
onLoadEnd();
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ const ImageLoader = {
|
|||||||
image.onerror = onError;
|
image.onerror = onError;
|
||||||
image.onload = e => {
|
image.onload = e => {
|
||||||
// avoid blocking the main thread
|
// avoid blocking the main thread
|
||||||
const onDecode = () => onLoad();
|
const onDecode = () => onLoad({ nativeEvent: e });
|
||||||
if (typeof image.decode === 'function') {
|
if (typeof image.decode === 'function') {
|
||||||
// Safari currently throws exceptions when decoding svgs.
|
// Safari currently throws exceptions when decoding svgs.
|
||||||
// We want to catch that error and allow the load handler
|
// We want to catch that error and allow the load handler
|
||||||
|
|||||||
Reference in New Issue
Block a user