Skip to content
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

pass allPages to itemRender #106

Closed
wants to merge 1 commit into from
Closed

Conversation

zation
Copy link

@zation zation commented Aug 17, 2017

So that I can use it to detect if current page is the last page

@coveralls
Copy link

Coverage Status

Coverage remained the same at 71.357% when pulling e1e5dff on zation:master into 384fe99 on react-component:master.

@benjycui
Copy link
Member

Nope, just:

const allPages
<Pagination itemRender={() => allPages} />

@benjycui benjycui closed this Aug 18, 2017
@zation
Copy link
Author

zation commented Aug 18, 2017

@benjycui allPages is already calculated by Pagination, I don't want to write same code to calculate it again...

@benjycui
Copy link
Member

Sorry, it's weirdo to let pagination tell you something you told it before.

@zation
Copy link
Author

zation commented Aug 18, 2017

The calculation logic happens inside pagination. Users only tell pagination the total account and page size, but not the calculation logic. So I actually don't know what the allPages should be.

If pagination provides allPagesCalculator prop, it makes sense that pagination should not tell me what allPages is. But...

In another side, this will be more convenient to use itemRender and more consistent for allPages value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants