random512
random512

Reputation: 1095

Image not displaying in web view of snack.expo.io?

I'm using snack.expo.io for React Native development. In my render() method, I'm including an Image reference like this:

return (
  <View>
      <Image source={require('./assets/my-image.png')} />
  </View>
);

The image displays as expected in the "Android" and "iOS" preview tabs but nothing is displayed in the "Web" preview tab. Any idea what the issue might be here?

Upvotes: 1

Views: 2031

Answers (1)

Oleg Levin
Oleg Levin

Reputation: 3621

I created expo snack example with image: https://snack.expo.io/@djalik/image-demo

You have to define style for Image in the web version.

Upvotes: 2

Related Questions