vutoan266 / react-images-uploading

The simple images uploader applied Render Props pattern that allows you to fully control UI component and behaviors.
https://github.com/vutoan266/react-images-uploading
MIT License
320 stars 52 forks source link

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

Open bebru2k1 opened 2 years ago

bebru2k1 commented 2 years ago

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

AlDiAlisel commented 2 years ago

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) => (