Skip to content

Commit

Permalink
fix(useDropZone): improve argument type (#1933)
Browse files Browse the repository at this point in the history
  • Loading branch information
aki77 committed Jul 17, 2022
1 parent af3b34d commit 2670e23
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/useDropZone/demo.vue
Expand Up @@ -15,7 +15,7 @@ function onDrop(files: File[] | null) {
}
}
const dropZoneRef = ref<HTMLElement | null>(null)
const dropZoneRef = ref<HTMLElement>()
const { isOverDropZone } = useDropZone(dropZoneRef, onDrop)
</script>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/useDropZone/index.md
Expand Up @@ -12,7 +12,7 @@ Create an zone where files can be dropped.
<script setup lang="ts">
import { useDropZone } from '@vueuse/core'
const dropZoneRef = ref(null)
const dropZoneRef = ref<HTMLDivElement>()
function onDrop(files: File[] | null) {
// called when files are dropped on zone
Expand Down
2 changes: 1 addition & 1 deletion packages/core/useDropZone/index.ts
Expand Up @@ -8,7 +8,7 @@ export interface UseDropZoneReturn {
isOverDropZone: Ref<boolean>
}

export function useDropZone(target: MaybeRef<HTMLElement | null>, onDrop: (files: File[] | null) => void): UseDropZoneReturn {
export function useDropZone(target: MaybeRef<HTMLElement | null | undefined>, onDrop: (files: File[] | null) => void): UseDropZoneReturn {
const isOverDropZone = ref(false)
let counter = 0

Expand Down

0 comments on commit 2670e23

Please sign in to comment.