I have declared this array and I want to go through it in the return so that it is printed with the Image tag.
const appDataImages = [
{id: 1, link: '../../assets/images/face-1.png'},
{id: 2, link: '../../assets/images/face-2.png'},
{id: 3, link: '../../assets/images/face-3.png'},
{id: 4, link: '../../assets/images/face-4.png'},
{id: 5, link: '../../assets/images/face-5.png'},
{id: 6, link: '../../assets/images/face-5.png'},];
The problem is that when I am going through the loop I get that this form is not correct and I tried it in several ways. The error is given to me in the require.
<View style={styles.view}>
{appDataImages.map(image => (
<Image
key={image.id}
source={require(image.link)}
style={styles.image}
/>
))}
</View>
I already managed to solve it, simply change the array and directly put the require there.