after loading error Image does not show defaultSource and does not respect style
See original GitHub issueDescription
I want to use Image to display a remote PNG. Therefore I setup the URL in the source
prop. Before the image is ready to be displayed I want to show a placeholder image. I used the defaultSource
to a local asset/image.
React Native version:
0.63.2
Steps To Reproduce / Expected Results
basic setup:
<Image source=... defaultSource=... />
local = require(‘…image.png’)
remote = { uri: … }
cases:
source=local -> ok, shows local image
source=remote -> ok, shows local image
defaultSource=local
source=malformed remote
-> I expect to see the local image but there is nothing.
Additionally, I setup a border in style
but also this border is not shown.
onError is called as expected.
and the docs:
Also it is not clear to me what is the difference between the following props, because both talk about “loading”
defaultSource
A static image to display while loading the image source.
loadingIndicatorSource
…displayed until image is ready to be displayed, typically after when it got downloaded from network.
Snack, code example, screenshot, or link to a repository:
N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (2 by maintainers)
Experiencing the same issue on android in release build on react native 0.63.2, default source prop is not working and sometimes giving image splash and becomes invisible again, plus the default source is also not respecting the image style.
Hi @voxspox, thanks for the issue. Could you provide a repo/snack example that I could build? and also please note that on Android, the default source prop is ignored on debug builds. https://reactnative.dev/docs/image.html#defaultsource