react-images-uploading icon indicating copy to clipboard operation
react-images-uploading copied to clipboard

how do i add multiple images that i already have the path to the component?

Open bebru2k1 opened this issue 1 year ago • 1 comments

how do i add multiple images that i already have the path to the component?

bebru2k1 avatar Jul 12 '22 14:07 bebru2k1

if i have understand correctly the question you can create your own list of images and after you can iterate that on the compenent(1), if you wanna add after the uploaded images on your own list you can do this in the onChange(2) function

(2) <ImageUploading multiple value={images} onChange={onChange} (2) const onChange = (imageList, addUpdateIndex) => { setYourOwnList([...yourOwnList,imageList[addUpdateIndex].data_url]) }

(1) yourOwnList.map((image, index) => ( <ImageListItem key={index}> <img src={image}

AlDiAlisel avatar Aug 04 '22 18:08 AlDiAlisel