Is your feature request related to a problem? Please describe.
As of now, the only way to get the value of which page a user clicked within a Pagination component is by the .innerText. We should not be storing and reading values based on DOM strings.
Describe the solution you'd like
Simply add a value={page} or data-page={page} with the actual page number value for better readability and structure:
Does your feature request relate to a specific USWDS component?
Pagination specifically: https://github.com/trussworks/react-uswds/blob/main/src/components/Pagination/Pagination.tsx
What USWDS Version is this feature present in?
ALL
Is your feature request related to a problem? Please describe.
As of now, the only way to get the value of which page a user clicked within a Pagination component is by the
.innerText
. We should not be storing and reading values based on DOM strings.Describe the solution you'd like
Simply add a
value={page}
ordata-page={page}
with the actual page number value for better readability and structure:https://github.com/trussworks/react-uswds/blob/main/src/components/Pagination/Pagination.tsx#L43-L54