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
Add a custom render function for page link text #334
Conversation
Thanks for this amazing PR, I need it for my project right now.. |
Sure! I feel like the test I wrote gives the best example if you switch over to the code tab of this PR, but here's another explanation for you. The paginate component now has a new property called const data = [
{ name: 'Item 1' },
{ name: 'Item 2' },
{ name: 'Item 3' },
{ name: 'Item 4' },
{ name: 'Item 5' },
];
<PaginationBoxView
pageCount={data.length}
pageLabelRender={(index) => data[index]?.name}
/> |
Hello, Could we:
<PaginationBoxView
pageCount={data.length}
pageLabelRender={(page) => {
const pageIndex = page - 1;
return data[pageIndex]?.name;
}}
/> Please? :) |
I made the suggested changes except I left the |
You're right, thanks. Thank you very much for your work on this PR. I've just renamed the prop |
#333