Using webpack I can import images from a folder
let i = 0;
const imgs =[];
let img;
for(i=0;i<3;i++){
img = require( '../Resources/OtherProjects/'+props.type+'/'+i+'.jpg' );
imgs.push(img);
}
where props.type
gives me a different folder to create an array for each folder in my dynamic component
my question is : there is a better way?
also , there is a way to get how many images are in my folder?
- require.context only works for an specific folder , but not for each folder