When I am trying to load image from props i am getting the following error
warning: failed prop type: invalid prop source
supplied to image
As the React Native Documentation says, all your images sources needs to be loaded before compiling your bundle.
Adding a simple image in React Native should be like this:
Let's say you have this:
const slides = {
car: './car.png',
phone: '../phone.png',
}
Then you pass slides
as a parameter but still, you won't be able to use it like this (even though logically should work):
Use require()
inside the sildes{}
const slides = {
car: require('./car.png'),
phone: require('../phone.png'),
}
And the use it like this: