Skip to content

Commit

Permalink
fix(link): deprecated onClick warning on using onPress (#3569)
Browse files Browse the repository at this point in the history
* 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 <wingkwong.code@gmail.com>
  • Loading branch information
awesome-pro and wingkwong authored Aug 29, 2024
1 parent 9d6bcb5 commit 3c0a486
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/red-ducks-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nextui-org/link": patch
---

use `@nextui-org/use-aria-link` to suppress onClick deprecation warning (#3196)
3 changes: 2 additions & 1 deletion packages/components/link/src/use-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3c0a486

Please sign in to comment.