Light and simple Reactjs drag and drop files library to use with very flexible options to change, so you put whatever the design you want for your drop-area. Users can drag and drop or even select the file anywhere in the window.
MIT License
245
stars
86
forks
source link
refactor: changed return type for handleChanges in useDragging Params #126
Declared function handleChanges in FileUploader.tsx returns boolean, but in useDragging.tsx Params it's defined as void. Later its return value is checked, but this part of code in useDragging.tsx
const success = handleChanges(files);
if (onDrop && success) onDrop(files);
generates a warning "An expression of type 'void' cannot be tested for truthiness"
Key Changes
Params typing in useDragging.tsx
Check List
[ ] The changes to the "Readme" file(if needed)
[x] The changes not breaking any old rule of the library or usage
Summary
Declared function handleChanges in
FileUploader.tsx
returns boolean, but inuseDragging.tsx
Params it's defined as void. Later its return value is checked, but this part of code inuseDragging.tsx
generates a warning
"An expression of type 'void' cannot be tested for truthiness"
Key Changes
Check List