I have an avatar component and inside it it has the following XML
<Image
source={avatars && avatars[deferredKey]
? { uri: avatars[deferredKey] } : defaultAvatar}
style={{
width: size, height: size, borderRadius: size / 2, ...containerStyle,
}}
onError={this.onError}
/>
When the app loads avatars is null so defaultAvatar loads, then a few seconds later the image receives new props and it should switch to the the uri image but it fails to do that.
When I change the code to
<Image
source={{ uri: avatars[deferredKey] }}
style={{
width: size, height: size, borderRadius: size / 2, ...containerStyle,
}}
onError={this.onError}
/>
Then the component works as expected with originally the avatar loads blank and a few seconds later it loads the uri image correctly.
The issue seems to only exist when the avatar has to switch from a locally stored asset to a uri.