File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -6,25 +6,20 @@ function kill (e) {
6
6
return false
7
7
}
8
8
9
- let nextId = 0
10
-
11
9
export default function DropTarget ( { onFileDrop, children, ...props } ) {
12
10
const onDrop = e => {
13
11
e . stopPropagation ( )
14
12
e . preventDefault ( )
15
13
onFileDrop ( e . dataTransfer . files [ 0 ] )
16
14
}
17
15
18
- const id = `DropTarget${ nextId ++ } `
19
-
20
16
return (
21
17
< div onDrop = { onDrop } onDragEnter = { kill } onDragOver = { kill } { ...props } >
22
18
{ children || (
23
19
< div className = 'h-100 ph3 pb3' >
24
- < label className = 'flex items-center justify-center h-100 br4 bw2 b--gray-muted b--dashed bg-snow-muted relative' for = { id } >
20
+ < label className = 'flex items-center justify-center h-100 br4 bw2 b--gray-muted b--dashed bg-snow-muted relative' >
25
21
< div >
26
22
< input
27
- id = { id }
28
23
type = 'file'
29
24
className = 'absolute top-0 o-0'
30
25
onChange = { e => onFileDrop ( e . target . files [ 0 ] ) } />
You can’t perform that action at this time.
0 commit comments