Open amcclain opened 10 months ago
I'd propose the following mildly-breaking (but not in a bad way) API changes:
targetText
prop accepts either a string (as it does now) or a function of the form ({draggedFiles}) => ReactNode
.
rejectText
prop accepts either a string or function of the form ({rejectedFiles}) => ReactNode
.
rejectedFiles
and instead pass some other data structure that has information about why a given file was rejected.https://github.com/react-dropzone/react-dropzone/issues/752 points to adding reasons for file rejection in the FileRejection object that onDrop and onDropRejected (of React Dropzone) take in react-dropzone version 11.0.0.
Expanding ticket to more general review of this comp and the various apps where we decided not to use it and had to roll our own.
The
FileChooser
component accepts atargetText
prop, but always shows its own text when actively hovering over the target. It does not provide any control over the text displayed when a drop is rejected.https://github.com/xh/hoist-react/blob/9538b51b8e8e8c23755d4ee9b215504a2b80f2a5/desktop/cmp/filechooser/FileChooser.ts#L93
We have a usage in a client app where we are showing the target in a tightly-managed layout and want the ability to customize both.