Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UploadWithCrop.jsx - react-uploady demo
import Uploady from "@rpldy/uploady";
import UploadButton from "@rpldy/upload-button";
import UploadPreview from "@rpldy/upload-preview";
export default function UploadWithCrop() {
const previewMethodsRef = useRef();
return (
<Uploady
destination={{ url: "[upload-url]" }}
>
<div>
<UploadButton>Upload Files</UploadButton>
<br />
<UploadPreview
PreviewComponent={ItemPreviewWithCrop}
previewComponentProps={{ previewMethods: previewMethodsRef }}
previewMethodsRef={previewMethodsRef}
fallbackUrl="https://icon-library.net/images/image-placeholder-icon/image-placeholder-icon-6.jpg"
/>
</div>
</Uploady>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment