From d9d41d574c4da06f5965cd6a00aa097a56334341 Mon Sep 17 00:00:00 2001 From: WK Wong Date: Tue, 14 Jan 2025 00:46:53 +0800 Subject: [PATCH 1/5] fix(use-aria-link): onClick deprecation warning --- packages/hooks/use-aria-link/src/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/hooks/use-aria-link/src/index.ts b/packages/hooks/use-aria-link/src/index.ts index eb3d9e1c64..c0b5bba47a 100644 --- a/packages/hooks/use-aria-link/src/index.ts +++ b/packages/hooks/use-aria-link/src/index.ts @@ -21,6 +21,8 @@ export interface AriaLinkOptions extends AriaLinkProps { isDisabled?: boolean; /** The role of the element */ role?: string; + /** The type of the element, e.g. 'button' */ + type?: string; /** * The HTML element used to render the link, e.g. 'a', or 'span'. * @default 'a' @@ -50,6 +52,7 @@ export function useAriaLink(props: AriaLinkOptions, ref: RefObject internally + type !== "button" && + // bypass since onClick is passed from