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

Is there anyway to persist uploaded image ?

Open TedSean opened this issue 3 years ago • 1 comments

Let's say we have a stepper and user uploads image and goes to next step. When user goes back to previous step, Image wouldn't stick to where it was uploaded. I think for this to work it may need to accept src attribute but I do not see any such props.

TedSean avatar May 20 '21 08:05 TedSean

Hi! I was facing the exact same issue within a stepper and forked the project to add the feature to set state from props.

https://github.com/ftruzzi/react-images-upload

Install it with npm install --save 'https://gitpkg.now.sh/ftruzzi/react-images-upload/src/component', and use the two new props files and pictures to persist state. Note that pictures replaces defaultImages.

<ImageUploader
  files={files}
  pictures={pictures}
  onChange={(files, pictures) => saveYourStateSomewhere(files, pictures)}
  ...
/>

@JakeHartnell would a PR be welcome?

ftruzzi avatar Sep 21 '21 09:09 ftruzzi