From a80d563385497c2ee496d4bc6ebfdd89465c0a7c Mon Sep 17 00:00:00 2001 From: WK Wong Date: Sun, 5 Jan 2025 16:40:25 +0800 Subject: [PATCH] fix(use-aria-link): onclick deprecation warning for Button as Link --- .changeset/sixty-fireants-build.md | 5 +++++ packages/hooks/use-aria-link/src/index.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/sixty-fireants-build.md diff --git a/.changeset/sixty-fireants-build.md b/.changeset/sixty-fireants-build.md new file mode 100644 index 0000000000..200fd93926 --- /dev/null +++ b/.changeset/sixty-fireants-build.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/use-aria-link": patch +--- + +fix onclick deprecation warning for Button as Link (#4493) diff --git a/packages/hooks/use-aria-link/src/index.ts b/packages/hooks/use-aria-link/src/index.ts index e47e0d1692..eb3d9e1c64 100644 --- a/packages/hooks/use-aria-link/src/index.ts +++ b/packages/hooks/use-aria-link/src/index.ts @@ -19,6 +19,8 @@ export interface AriaLinkOptions extends AriaLinkProps { "aria-current"?: DOMAttributes["aria-current"]; /** Whether the link is disabled. */ isDisabled?: boolean; + /** The role of the element */ + role?: string; /** * The HTML element used to render the link, e.g. 'a', or 'span'. * @default 'a' @@ -46,6 +48,7 @@ export function useAriaLink(props: AriaLinkOptions, ref: RefObject