[EuiPagination] Extract PaginationButton creation#5048
[EuiPagination] Extract PaginationButton creation#5048thompsongl merged 9 commits intoelastic:masterfrom
PaginationButton creation#5048Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5048/ |
CI errors will be resolved when the docs change is reverted |
cee-chen
left a comment
There was a problem hiding this comment.
QA'd the fix and it looks great! Super impressed by the clean and elegant solution to the problem also, huge kudos. Feel free to revert the resizable documentation example - I'll approve after that.
I mostly have small comments/questions that are by no means blockers, but would def appreciate your thoughts!
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5048/ |
cee-chen
left a comment
There was a problem hiding this comment.
Changes look great - thanks a million Greg!
I think resizable_container_basic.js changes still need to be reverted, but other than that looks GTG!
This reverts commit 6a99e4b.
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5048/ |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5048/ |
Summary
Fixes #5046, in which EuiPagination failed to update state in EuiResizableContainer. The problem was not with EuiResizableContainer specifically, but could occur anytime a pagination change resulted in a parent rerender. Because the internal
PaginationButtoncomponent was created inside another component, it was recreated with old state on every rerender.The solution here is to extract
PaginationButtoncreation, eliminating rerender recreation.See the to-be-reverted change in the first EuiResizableContainer example for verification.
Checklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Props have proper autodocs and playground toggles- [ ] Added documentation- [ ] Added or updated jest testsrevert medocs commit