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

fix(Pagination): Resolve Hydration Error by Refining Component Structure #2335

Closed
wants to merge 1 commit into from

Conversation

Unsleeping
Copy link

@Unsleeping Unsleeping commented Jan 8, 2024

I have removed the additional wrapper <PaginationItem> from the demo representation of the Pagination component. This adjustment was made as PaginationPrevious, PaginationLink, and PaginationNext already include the necessary PaginationItem wrapper internally.

Fixes #2323

Copy link

vercel bot commented Jan 8, 2024

@Unsleeping is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@Unsleeping
Copy link
Author

Also, I think we need to set a PaginationItem wrapper around PaginationEllipsis, similar to how it's done with PaginationLink, PaginationNext, and PaginationPrevious, to avoid inconsistency and write in demo like this:

<Pagination>
      <PaginationContent>
          <PaginationPrevious href="#" />
          <PaginationLink href="#">1</PaginationLink>
           ...
          <PaginationEllipsis />
          <PaginationNext href="#" />
      </PaginationContent>
</Pagination>    

instead of this:

<Pagination>
      <PaginationContent>
          <PaginationPrevious href="#" />
          <PaginationLink href="#">1</PaginationLink>
          ...
          <PaginationItem>
                <PaginationEllipsis />
          </PaginationItem>
          <PaginationNext href="#" />
      </PaginationContent>
</Pagination>     

@Unsleeping Unsleeping changed the title Update pagination.mdx fix(Pagination): Resolve Hydration Error by Refining Component Structure Jan 8, 2024
@shadcn
Copy link
Collaborator

shadcn commented Jan 18, 2024

@Unsleeping We fixed this in #2190. I'm going to close this one but feel free to reopen if you have any questions. Thanks for the PR. Appreciate it.

@shadcn shadcn closed this Jan 18, 2024
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

Successfully merging this pull request may close these issues.

Pagination component causes hydration error
2 participants