Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination bug #2405

Closed
deven298 opened this issue Jan 13, 2024 · 1 comment
Closed

Pagination bug #2405

deven298 opened this issue Jan 13, 2024 · 1 comment

Comments

@deven298
Copy link

The following code issues validateDOMNesting warning because <li> cannot appear as descendant of <li>.

<PaginationItem>
  <PaginationLink href="#">1</PaginationLink>
</PaginationItem>

According to the definition of PaginationLink as shown below it uses the <PaginationItem> within its definition leading to above warning.

const PaginationLink = ({
  className,
  isActive,
  size = "icon",
  ...props
}: PaginationLinkProps) => (
  <PaginationItem>
    <a
      aria-current={isActive ? "page" : undefined}
      className={cn(
        buttonVariants({
          variant: isActive ? "outline" : "ghost",
          size,
        }),
        className
      )}
      {...props}
    />
  </PaginationItem>
)
PaginationLink.displayName = "PaginationLink"
@deven298
Copy link
Author

deven298 commented Jan 18, 2024

Fixed in #2190 . Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant