Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
react-uploady paste to upload example
import React from "react";
import styled from "styled-components";
import Uploady from "@rpldy/uploady";
import UploadDropZone from "@rpldy/upload-drop-zone";
import withPasteUpload from "@rpldy/upload-paste";
const StyledDropZone = styled(UploadDropZone)`
width: 400px;
height: 400px;
border: 1px solid #000;
`;
const PasteUploadDropZone = withPasteUpload(StyledDropZone);
export const MyApp = (): Node => {
return <Uploady multiple
destination={{ url: "my-server.com/upload" }}>
<PasteUploadDropZone autoUpload={false} params={{ test: "paste" }}>
You can drop a file here
<br/>
OR
<br/>
click and paste a file to upload
</PasteUploadDropZone>
</Uploady>
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment