Socket
Socket
Sign inDemoInstall

react-dropzone

Package Overview
Dependencies
Maintainers
3
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dropzone - npm Package Compare versions

Comparing version 11.0.1 to 11.0.2

28

examples/accept/README.md

@@ -17,7 +17,12 @@ By providing `accept` prop you can make the dropzone accept specific file types and reject the others.

function Accept(props) {
const {acceptedFiles, rejectedFiles, getRootProps, getInputProps} = useDropzone({
const {
acceptedFiles,
fileRejections,
getRootProps,
getInputProps
} = useDropzone({
accept: 'image/jpeg, image/png'
});
const acceptedFilesItems = acceptedFiles.map(file => (
const acceptedFileItems = acceptedFiles.map(file => (
<li key={file.path}>

@@ -28,5 +33,10 @@ {file.path} - {file.size} bytes

const rejectedFilesItems = rejectedFiles.map(file => (
const fileRejectionItems = fileRejections.map({ file, errors}) => (
<li key={file.path}>
{file.path} - {file.size} bytes
<ul>
{errors.map(e => (
<li key={e.code}>{e.message}</li>
)}
</ul>
</li>

@@ -37,3 +47,3 @@ ));

<section className="container">
<div {...getRootProps({className: 'dropzone'})}>
<div {...getRootProps({ className: 'dropzone' })}>
<input {...getInputProps()} />

@@ -45,9 +55,5 @@ <p>Drag 'n' drop some files here, or click to select files</p>

<h4>Accepted files</h4>
<ul>
{acceptedFilesItems}
</ul>
<ul>{acceptedFileItems}</ul>
<h4>Rejected files</h4>
<ul>
{rejectedFilesItems}
</ul>
<ul>{fileRejectionItems}</ul>
</aside>

@@ -54,0 +60,0 @@ </section>

@@ -168,3 +168,3 @@ {

},
"version": "11.0.1",
"version": "11.0.2",
"engines": {

@@ -171,0 +171,0 @@ "node": ">= 8"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc