We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"use client"; import dynamic from "next/dynamic"; // https://github.com/fortana-co/react-dropzone-uploader // react-dropzone-uploader import "react-dropzone-uploader/dist/styles.css"; import Dropzone from "react-dropzone-uploader"; import { useState } from "react"; export const DropzoneUploader = () => { // specify upload params and url for your files const [isUpdatePreview, setIsUpdatePreview] = useState(false); const getUploadParams = ({ meta }: any) => { return { url: "https://httpbin.org/post" }; }; // called every time a file's `status` changes const handleChangeStatus = ({ meta, file }: any, status: any) => { setIsUpdatePreview(!isUpdatePreview); console.log(status, meta, file); }; // receives array of files that are done uploading when submit button is clicked const handleSubmit = (files: any) => { console.log(files.map((f: any) => f.meta)); }; return ( <Dropzone getUploadParams={getUploadParams} onChangeStatus={handleChangeStatus} onSubmit={handleSubmit} accept="image/*,audio/*,video/*" /> ); };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: