I'm trying to display image by map an array of image, but i faced this error Invalid call at line 13: require(item)
Here is the code
/* eslint-disable react-native/no-inline-styles */
import React from 'react';
import {Image, TouchableOpacity, View} from 'react-native';
export default function ImageShow() {
const imagePath = ['./Ellipse2.png', './Ellipse3.png'];
return (
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
{imagePath.map((item, index) => (
<TouchableOpacity
key={index}
style={{width: 80, height: 80, borderColor: 'grey', borderWidth: 1}}>
<Image source={require(item)} />. ==> ERROR HERE
</TouchableOpacity>
))}
</View>
);
}
Image path is correct, i try to change item
with path to item, and it work, so it not because of path, but i still don't know how to display multi image at the sametime, using expo
Please help, thank a lots