Skip to content

Commit

Permalink
[EuiPagination] Add keys for EuiI18n values in compressed count text (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
acstll authored Jan 7, 2025
1 parent 2b08104 commit 41cf816
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/eui/changelogs/upcoming/8243.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Ensures that the `values` of `EuiI18n` used in `EuiPagination` use `key` attributes to prevent potential ["unique key" warnings](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key).
4 changes: 2 additions & 2 deletions packages/eui/src/components/pagination/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ export const EuiPagination: FunctionComponent<Props> = ({
token="euiPagination.pageOfTotalCompressed"
default="{page} of {total}"
values={{
page: <span>{activePage + 1}</span>,
total: <span>{pageCount}</span>,
page: <span key="activePage">{activePage + 1}</span>,
total: <span key="pageCount">{pageCount}</span>,
}}
/>
</EuiText>
Expand Down

0 comments on commit 41cf816

Please sign in to comment.