question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Release notes for breaking change to `accept` in v12.0.0 are ambiguous

See original GitHub issue

Describe the bug

I don’t think its clear what the breaking change to accept refers to in https://github.com/react-dropzone/react-dropzone/releases/tag/v12.0.0

Does it, for example, involve a breaking change to the accept prop provided to useDropzone documented here. That uses react-dropzone/attr-accept which does not seem to have changed so I am confused by the release note.

Expected

Clear actions to take when a breaking change is reported in the package.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
rolandjitsucommented, Feb 7, 2022

Thanks for clarifying that. So to resolve the breaking change I would change as follows?:

useDropzone({
    accept: 'image/jpeg, image/png',
 });

It should change to:

useDropzone({
    accept: { 'image/*': ['.jpeg', '.jpg'] },
 });

Ok, no. Let me try to clarify. When you use accept=".jpg", the file picker when triggered by click, it will not filter because the FS access API expects what you just posted above.

That’s because we do not keep a map of file ext => MIME type. But if you pass mime types accept="image/png", the file picker will work because we internally turn that string into the object that the FS access API needs:

https://github.com/react-dropzone/react-dropzone/blob/df8a9b4231b98fbc8b964c3cf0ca5f8682a50613/src/utils/index.js#L183

So, in summary:

  1. the type for accept has not changed; it still takes a string or list of strings
  2. in browsers that do not support the FS access API, the accept attr works exactly the same as in previous versions of react-dropozone, for both file picker and dag ‘n’ drop
  3. in browser that support the FS access API, when passing file extensions to accept (e.g ".jpg,.png"), the file picker will not apply those filters, but drag ‘n’ drop will
  4. the use of FS access API can be turned off via useDropzone({useFsAccessApi: false})
1reaction
rolandjitsucommented, Feb 7, 2022

I’ve created https://github.com/react-dropzone/react-dropzone/pull/1139 which hopefully makes it more clear. See staging docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scheduler Release Notes - VMware Tanzu Docs
This topic contains release notes for Scheduler v1.6.0. Releases. v1.6.3. Release Date: November 7, 2022. [Bug Fix] Resolve deployment issue when using Java ......
Read more >
BIG-IP 14.1.5.1 Fixes and Known Issues - AskF5
BIG-IP Release Information Version: 14.1.5.1. Build: 6.0. Note: This content is current as of the software release date. Updates to bug information occur ......
Read more >
RTA-OS Release Note (10766-RN-12.0.0) - ETAS
V12.0.0. RTA-OS. Release Note - Version 12.0.0 (17-08-2022) ... V12.0.0. • Changed messages and reports from the OS library to use the spelling...
Read more >
Release Notes - 32 - MythTV Official Wiki
Almost 1300 improvements to the codebase (commits not listed below). Prerequisite Changes. Added support libraries/prerequisites. libzip ...
Read more >
Luminous - Ceph Documentation
This is the 13th bug fix release of the Luminous v12.2.x long term stable release ... ceph-volume: broken assertion errors after pytest changes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found