I am just starting out with React-native and have a pretty decent grasp on React for creating web apps... I am running into a confusing issue here that never occured when wo
you should be use uri for set source image
return (
<Image
source={{uri: 'https://reactnative.dev/docs/assets/p_cat2.png'}}
/>
);
You should either require the local assets or use object with uri
key.
So either in MainComponent
:
this.state = {
images:[
require('./src/images/1.png'),
require('./src/images/2.png'),
require('./src/images/3.png')
]
}
or in BasicComponent
:
return (
<Image
source={{uri: this.props.source}}
/>
);