Skip to content

Commit 6ba510b

Browse files
committed
fix(utils): fix spelling of DropzoneHandlers
The DropzoneHanders will be removed in the next major release.
1 parent 2d20a2e commit 6ba510b

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

packages/utils/src/__tests__/useDropzone.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import type { ReactElement, ReactNode } from "react";
22
import cn from "classnames";
33
import { fireEvent, render } from "@testing-library/react";
44

5-
import type { DropzoneHanders } from "../useDropzone";
5+
import type { DropzoneHandlers } from "../useDropzone";
66
import { useDropzone } from "../useDropzone";
77

88
function Test({
99
children,
1010
...options
11-
}: DropzoneHanders<HTMLElement> & { children?: ReactNode }): ReactElement {
11+
}: DropzoneHandlers<HTMLElement> & { children?: ReactNode }): ReactElement {
1212
const [isOver, handlers] = useDropzone(options);
1313

1414
return (

packages/utils/src/useDropzone.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
import type { DragEvent, HTMLAttributes } from "react";
22
import { useCallback, useState } from "react";
33

4-
/** @remarks \@since 2.9.0 */
5-
export type DropzoneHanders<E extends HTMLElement> = Pick<
4+
/**
5+
* @remarks \@since 2.9.0
6+
* @deprecated \@since 5.1.3 Use `DropzoneHandlers` instead.
7+
*/
8+
export type DropzoneHanders<E extends HTMLElement> = DropzoneHandlers<E>;
9+
10+
/** @remarks \@since 5.1.3 */
11+
export type DropzoneHandlers<E extends HTMLElement> = Pick<
612
HTMLAttributes<E>,
713
"onDragEnter" | "onDragOver" | "onDrop" | "onDragLeave"
814
>;
915

1016
/** @remarks \@since 2.9.0 */
1117
export type DropzoneHookReturnValue<E extends HTMLElement> = [
1218
boolean,
13-
DropzoneHanders<E>
19+
DropzoneHandlers<E>
1420
];
1521

1622
/**
@@ -44,13 +50,13 @@ export type DropzoneHookReturnValue<E extends HTMLElement> = [
4450
* ```
4551
*
4652
* @see {@link useFileUpload} for a more complex example
47-
* @param options - The {@link DropzoneHanders} that can be merged with the
53+
* @param options - The {@link DropzoneHandlers} that can be merged with the
4854
* default functionality.
4955
* @returns the {@link DropzoneHookReturnValue}
5056
* @remarks \@since 2.9.0
5157
*/
5258
export function useDropzone<E extends HTMLElement>(
53-
options: DropzoneHanders<E>
59+
options: DropzoneHandlers<E>
5460
): DropzoneHookReturnValue<E> {
5561
const {
5662
onDragEnter: propOnDragEnter,

0 commit comments

Comments
 (0)