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

#18 use current page prop before falling back to page 1 when setting initial page #30

Merged
merged 2 commits into from
Sep 22, 2021

Conversation

codenaz
Copy link
Owner

@codenaz codenaz commented Sep 22, 2021

What does this MR do?
This MR implements setting the initial page to the current page prop in the event that such value is available and defaults to 1 when it isn't.

Common use case
If you store your current page as a URL query. e.g ?page=3, you can fetch the value of this query parameter when your app loads and pass it to the react-hooks-paginator component as your currentPage prop

@codenaz codenaz merged commit 521c313 into master Sep 22, 2021
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.

1 participant