Skip to content

feat: allow linkProps to accept a callback receiving target page number - #188

Open
chsousaa wants to merge 1 commit into
etchteam:mainfrom
chsousaa:feat/link-props-page-callback
Open

chsousaa wants to merge 1 commit into
etchteam:mainfrom
chsousaa:feat/link-props-page-callback

Conversation

@chsousaa

@chsousaa chsousaa commented Dec 1, 2026

Copy link
Copy Markdown

Closes #62

Summary

Allows linkProps to accept either a static props object (existing behavior) or a function (page: number) => Record<string, unknown> receiving the target page number for Previous (currentPage - 1), numbered page items (pageNumber), and Next (currentPage + 1) links.

<Pagination
  total={100}
  linkProps={(page) => ({ as: `/page/${page}/` })}
/>

Verification

  • npm run build
  • npm test (tsc + Jest unit tests for both static object and callback linkProps)
  • ./node_modules/.bin/eslint --max-warnings=0 src/index.tsx src/index.test.ts

@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

@mergify
mergify Bot requested review from a team and annie-seaward and removed request for a team December 1, 2026 22:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Providing the value of the pagination button clicked to linkProps

1 participant