Skip to content

Instantly share code, notes, and snippets.

@yoavniran
Created May 21, 2020 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoavniran/8ef82cf69b02c9c4eb04543dc43ff0d8 to your computer and use it in GitHub Desktop.
Save yoavniran/8ef82cf69b02c9c4eb04543dc43ff0d8 to your computer and use it in GitHub Desktop.
React-Uploady preview with progress demo - UploadWithProgressPreview.jsx
import UploadButton from "@rpldy/upload-button";
import UploadPreview from "@rpldy/upload-preview";
import CustomImagePreview from "./CustomImagePreview";
const UploadWithProgressPreview = () => {
const getPreviewProps = useCallback(item => ({ id: item.id }), []);
return (
<>
<UploadButton>Upload Files</UploadButton>
<br />
<UploadPreview
previewComponentProps={getPreviewProps}
PreviewComponent={CustomImagePreview}
/>
</>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment