0

I want to upload multiples images then display them in browser. I wrote this code mentioned by this link. I got the name of images displayed in place of images:

Image1.png
Image2.png 

How can I fix that and if someone knows another npm module which upload and display images as a gallery I will be grateful if mentioned it to me.

1 Answer 1

1

Adding the property withPreview to the <ImageUploader /> gives you a preview of all "uploaded" images.

const UploadImage = props => {
  const { onDrop } = props;
  return (
    <ImageUploader
      withIcon
      buttonText="Upload Image"
      onChange={onDrop}
      imgExtension={[".jpg", ".gif", ".png", ".gif"]}
      maxFileSize={5242880}
      withPreview
    />
  );
};

You can see this change implemented here.

This library looks like it can achieve what you want right out the box. See the documentation for the library for more details.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.