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