SSR: Specifying `multiple` prop results in hydrate error
See original GitHub issueDo you want to request a feature or report a bug?
- I found a bug
- I want to propose a feature
What is the current behavior?
While using server-side rendering, if the multiple
prop is specified then an error is produced when calling hydrate()
:
Warning: Prop `multiple` did not match. Server: "false" Client: "true"
Upon investigation, this is related to the fix implemented in https://github.com/react-dropzone/react-dropzone/issues/775 which causes the component’s multiple
prop at https://github.com/react-dropzone/react-dropzone/blob/8abd6ec7a780fbcfcf5b0ffd7642935998029005/src/index.js#L712 to always evaluate to false
on the server (since there is no document
on the server).
If the current behavior is a bug, please provide the steps to reproduce.
- Render the component via nextjs or some other custom SSR solution.
- Specify the
multiple
prop when using the component. - Open console and load the page. On hydration it should give the error specified above.
What is the expected behavior? There should be no difference in the component’s props upon hydration.
If this is a feature request, what is motivation or use case for changing the behavior? N/A
Please mention other relevant information such as the browser version, Operating System and react-dropzone version.
Versions used:
- react-dropzone v10.1.0
- React v16.8.6
- nodejs v10.15.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
🎉 This issue has been resolved in version 10.1.2 🎉
The release is available on:
Your semantic-release bot 📦🚀
I guess we could do that. Looking at accept, there’s also browsers that don’t support it, yet we haven’t received any reports of it being an issue.
I wonder why was the check introduced, I will try to check the commit history and find out if it was an issue before removing it.