From 3c0a486ceaa73479e5909d3add1cd14619f62796 Mon Sep 17 00:00:00 2001 From: Abhinandan Date: Thu, 29 Aug 2024 10:23:23 +0530 Subject: [PATCH] fix(link): deprecated onClick warning on using onPress (#3569) * fix(navbar): fixed the height when style h-full * fix(navbar): fixed the height when style h-full * fix(link): deprecated onClick warning on using onPress * refactor(link): add comment * chore(changeset): revise changeset message --------- Co-authored-by: WK Wong --- .changeset/red-ducks-greet.md | 5 +++++ packages/components/link/src/use-link.ts | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/red-ducks-greet.md diff --git a/.changeset/red-ducks-greet.md b/.changeset/red-ducks-greet.md new file mode 100644 index 000000000..b7fe7249c --- /dev/null +++ b/.changeset/red-ducks-greet.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/link": patch +--- + +use `@nextui-org/use-aria-link` to suppress onClick deprecation warning (#3196) diff --git a/packages/components/link/src/use-link.ts b/packages/components/link/src/use-link.ts index 3bd7ef156..619f84a6c 100644 --- a/packages/components/link/src/use-link.ts +++ b/packages/components/link/src/use-link.ts @@ -2,7 +2,7 @@ import type {AriaLinkProps} from "@react-types/link"; import type {LinkVariantProps} from "@nextui-org/theme"; import {link} from "@nextui-org/theme"; -import {useLink as useAriaLink} from "@react-aria/link"; +import {useAriaLink} from "@nextui-org/use-aria-link"; import { HTMLNextUIProps, mapPropsVariants, @@ -67,6 +67,7 @@ export function useLink(originalProps: UseLinkProps) { const disableAnimation = originalProps?.disableAnimation ?? globalContext?.disableAnimation ?? false; + // use `@nextui-org/use-aria-link` to suppress onClick deprecation warning const {linkProps} = useAriaLink( { ...otherProps,