React-Dropzone throws errors since 8.0.0 (after the breaking changes)
See original GitHub issue- I found a bug
- I want to propose a feature
What is the current behavior? React-Dropzone throws errors since 8.0.0, after the breaking changes
<Dropzone>
{({getRootProps}) => <div {...getRootProps()} />}
</Dropzone>
If the current behavior is a bug, please provide the steps to reproduce.
Tried adding the props to my code, tried the examples, none of them work.
I’m using Windows 10 pro 64bit, node v8.12.0.
Tested both react-dropzone 8.0.0 and 8.0.1.
TypeError: children is not a function
render
.../node_modules/react-dropzone/dist/es/index.js:474
471 | var isMultipleAllowed = multiple || filesCount <= 1;
472 | var isDragAccept = filesCount > 0 && allFilesAccepted(draggedFiles, this.props.accept);
473 | var isDragReject = filesCount > 0 && (!isDragAccept || !isMultipleAllowed);
> 474 | return children({
| ^ 475 | isDragActive: isDragActive,
476 | isDragAccept: isDragAccept,
477 | isDragReject: isDragReject,```
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:6
Top Results From Across the Web
react-dropzone
Simple React hook to create a HTML5-compliant drag'n'drop zone for files. Documentation and examples at https://react-dropzone.js.org.
Read more >Changelog | Finsemble
Fixed a bug where a React error was thrown by the Workspace Preferences tab. ... Finsemble Assimilation has been updated to Assimilation version...
Read more >How to solve 'prop type error' for my react-dropzone app
I've tried to add a getRootprops() like it says to do in the docs but I'm still experiencing the breaking issue. Here's a...
Read more >JavaScript Data Grid Migrate from 7.4 to 8.0 - Handsontable
This modification is a major rewrite of a core feature and may result in breaking changes in your application. General guidelines. Check if...
Read more >Migration Guide | Cypress Documentation
Migrating to Cypress 12.0 This guide details the changes and how to ... errors since the errors are representative of the previous test....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@StefanoSega yes, that’s expected. You’re required to provide a child fn and apply at least the props from
getRootProps()
on the jsx element that your child fn returns. E.g.:@RosenTomov if you don’t share a repo or something I cannot help. All the examples at react-dropzone.js.org work as expected as far as I can tell.
@rolandjitsu Ok, I’m sorry. Turns out that I had a second obscure Dropzone in my code, which was causing this.
After adding the properties, it works perfectly. Feel free to close the issue.
example with the Dropzone, I forgot about: