React Native, getting "Module not found: Can't resolve" error while using ImageBackground

Viewed 37

Got this error while making background image to modal window :

enter image description here

1 Answers

You are using an external image, so the way is to give source an object with uri field instead of using require, like so:

<ImageBackground 
  source={{uri:'https://via.placeholder.com/500'}}> 
  resizeMode="cover" 
  style={styles.imgBackground}
>
   <Text>Some text...</Text>
</ImageBackground>
Related