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