KarimMokhtar / react-drag-drop-files

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

Closed Charlie789 closed 1 year ago

Charlie789 commented 1 year ago

Summary

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

Check List