import { DragEvent , DragEventHandler } from 'react' ; export const isDragFile = ( event ) => event . dataTransfer ?. types . includes ( 'Files' ) ; export const onlyDragFiles = ( eventHandler ) => ( event ) => { if ( isDragFile ( event ) ) { return eventHandler ( event ) ; } } ;