question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

after loading error Image does not show defaultSource and does not respect style

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
syedhaider03commented, Oct 2, 2020

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.

1reaction
gedeagascommented, Aug 25, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

image default source not covering whole image view react ...
I want to give a placeholder image until the original image is loaded from the network so iam using the default source prop...
Read more >
How to set a default image when an image fails to load
When images don't load, the alt text is displayed in the container with a tiny icon signifying a broken image, like so:.
Read more >
Guidelines for CART Captioners (Communication Access ...
Web platforms that display CART captioning . ... image. Open captions do not need to be decoded and are always viewable. Open captions...
Read more >
Core Competencies for Interprofessional Collaborative Practice
We identify eight reasons why it is important to agree on a core set of ... may not be heard or acted upon...
Read more >
CDHO Registrants' Handbook
Information Custodians Who Are Not Health Care Professionals . ... The answers set out after each quiz may also be used for further...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found