I'm currently working on a page where I want to display all images in a folder. I tried the code below:
return (
<View>
{images.map(r =>
<Image source={require('../assets/image/' +r+'.png')} />
)}
</View>
);
Here is the result I am getting:
Error: pages/etc.js:Invalid call at line: require('../assets/image/' + r + '.png')
What should I do to fix this problem? Thanks.