Fix render loop on Android (#6213)
This commit is contained in:
@@ -396,10 +396,14 @@ const ImageItem = ({
|
|||||||
placeholderContentFit="cover"
|
placeholderContentFit="cover"
|
||||||
placeholder={{uri: imageSrc.thumbUri}}
|
placeholder={{uri: imageSrc.thumbUri}}
|
||||||
accessibilityLabel={imageSrc.alt}
|
accessibilityLabel={imageSrc.alt}
|
||||||
onLoad={e => {
|
onLoad={
|
||||||
|
hasLoaded
|
||||||
|
? undefined
|
||||||
|
: e => {
|
||||||
setHasLoaded(true)
|
setHasLoaded(true)
|
||||||
onLoad({width: e.source.width, height: e.source.height})
|
onLoad({width: e.source.width, height: e.source.height})
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
style={{flex: 1, borderRadius}}
|
style={{flex: 1, borderRadius}}
|
||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
|
|||||||
@@ -228,10 +228,14 @@ const ImageItem = ({
|
|||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
enableLiveTextInteraction={showControls && !scaled}
|
enableLiveTextInteraction={showControls && !scaled}
|
||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
onLoad={e => {
|
onLoad={
|
||||||
|
hasLoaded
|
||||||
|
? undefined
|
||||||
|
: e => {
|
||||||
setHasLoaded(true)
|
setHasLoaded(true)
|
||||||
onLoad({width: e.source.width, height: e.source.height})
|
onLoad({width: e.source.width, height: e.source.height})
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
|
|||||||
@@ -113,9 +113,13 @@ export function AutoSizedImage({
|
|||||||
accessibilityIgnoresInvertColors
|
accessibilityIgnoresInvertColors
|
||||||
accessibilityLabel={image.alt}
|
accessibilityLabel={image.alt}
|
||||||
accessibilityHint=""
|
accessibilityHint=""
|
||||||
onLoad={e => {
|
onLoad={
|
||||||
|
fetchedDims
|
||||||
|
? undefined
|
||||||
|
: e => {
|
||||||
setFetchedDims({width: e.source.width, height: e.source.height})
|
setFetchedDims({width: e.source.width, height: e.source.height})
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<MediaInsetBorder />
|
<MediaInsetBorder />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user