0.3.8 • Published 3 years ago
selfmade-react-dropzone v0.3.8
selfmade-react-dropzone
Simple React hook to create a HTML5-compliant drag'n'drop zone for files with support for auto-upload. This is based on react-dropzone
Demo
Installation
npm install --save selfmade-react-dropzone
or:
yarn add selfmade-react-dropzone
Usage
Please refer to react-dropzone for most of the functionality it offers.
For auto-uploading files, you need to pass uploadConfig
prop. To monitor the progress, you can access the files with status through uploadedFiles
state.
const {
acceptedFiles,
uploadedFiles,
draggedFiles,
getRootProps,
getInputProps
} = useDropzone({
uploadConfig: {
url: "https://httpbin.org/post", // required
metadata: {}, // optional
headers: {}, // optional
withCredentials: true, // optional
responseType: "json" // optional
}
});
License
MIT
0.3.6
3 years ago
0.3.5
3 years ago
0.3.8
3 years ago
0.3.7
3 years ago
0.3.4
3 years ago
0.3.3
3 years ago
0.3.0
3 years ago
0.2.9
3 years ago
0.3.2
3 years ago
0.3.1
3 years ago
0.2.8
3 years ago
0.2.7
3 years ago
0.2.6
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.1
3 years ago
0.1.0
3 years ago