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: #439 server side rendering of table with pagination #440

Merged
merged 1 commit into from May 1, 2022
Merged

fix: #439 server side rendering of table with pagination #440

merged 1 commit into from May 1, 2022

Conversation

tianenpang
Copy link
Member

Closes #439

πŸ“ Description

Fix the issue that row data is not rendered on the server side.

⛳️ Current behavior (updates)

Add rowsPerPage to the initialValues of TableContext so that TableBody can calculate rows correctly.

πŸš€ New behavior

Added hasPaginationChild method to check if there is a pagination and to get rowsPerPage by default 0.

πŸ’£ Is this a breaking change (Yes/No):

No

πŸ“ Additional Information

Screenshot of table with pagination ssr

table-ssr-pr

@codecov-commenter
Copy link

Codecov Report

Merging #440 (7b3e8a0) into main (15c0061) will decrease coverage by 0.04%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #440      +/-   ##
==========================================
- Coverage   74.77%   74.73%   -0.05%     
==========================================
  Files         174      174              
  Lines        2791     2802      +11     
  Branches      822      828       +6     
==========================================
+ Hits         2087     2094       +7     
- Misses        694      697       +3     
- Partials       10       11       +1     
Impacted Files Coverage Ξ”
packages/react/src/table/table-context.tsx 81.81% <33.33%> (-7.66%) ⬇️
packages/react/src/table/utils.ts 81.25% <75.00%> (-6.25%) ⬇️
packages/react/src/table/table.tsx 90.32% <100.00%> (ΓΈ)

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update 15c0061...7b3e8a0. Read the comment docs.

@jrgarciadev jrgarciadev changed the base branch from main to next May 1, 2022 19:06
@jrgarciadev
Copy link
Member

Huge thanks @tianenpang πŸ™πŸ»

@jrgarciadev jrgarciadev added this to the πŸ”₯ v1.0.0-beta.7 milestone May 1, 2022
@jrgarciadev jrgarciadev merged commit 6a34d2c into nextui-org:next May 1, 2022
@jrgarciadev jrgarciadev mentioned this pull request May 9, 2022
@tianenpang tianenpang deleted the fix/pagination-table-ssr branch December 21, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Table with pagination is not rendered on the server side
3 participants