Snack does not display remote images

Hello! I wanted to create a test case for a bug using snack, however it seems I can’t get images to work at all with it.

I tried:

  1. On my android 7 phone via expo app
  2. In the snack preview system - both android and iOS
  3. I changed to url to wikimedia image to make sure it’s not about hotlinking
  4. Retried, image still not there.

Thank you for help

Hi! I have a working example of an image in a Snack here:

I’d like to tell you why your example didn’t work:

From the React Native documentation:

Network Images
Many of the images you will display in your app will not be available at compile time, or you will want to load some dynamically to keep the binary size down. Unlike with static resources, you will need to manually specify the dimensions of your image. It’s highly recommended that you use https as well in order to satisfy App Transport Security requirements on iOS.

So with that being said, here is an example of what doesn’t work and what does work:

<Image source={{uri: ''}}
       style={{width: 400, height: 400}} />

// BAD
<Image source={{uri: ''}} />

I hope this clears things up for you! Best of luck and thank you for using Expo :slight_smile:


Should’ve read docs more carefully! Thank you

1 Like

No worries! Happens all the time :slight_smile: