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

How to set current page? #35

Closed
ap13p opened this issue Nov 25, 2015 · 9 comments
Closed

How to set current page? #35

ap13p opened this issue Nov 25, 2015 · 9 comments

Comments

@ap13p
Copy link

ap13p commented Nov 25, 2015

Let say I was typing directly in the urlbar to page 6, how I am supposed to pass this page number to ReactPaginate? Because it is always start at 1

@AdeleD
Copy link
Owner

AdeleD commented Nov 29, 2015

Hi,

You can pass the page number from url to ReactPaginate with prop initialSelected:

<ReactPaginate 
previousLabel={"previous"}
nextLabel={"next"}
initialSelected={6}
clickCallback={this.handlePageClick} />

@ap13p
Copy link
Author

ap13p commented Dec 1, 2015

Ok thanks

@ap13p ap13p closed this as completed Dec 1, 2015
@maxfarseer
Copy link

can't set this from props...
I try to reset page to '1' after sorting records.
Example: sort = city, page 8 => sort = country, page 1 (in this.props), but not in ReactPaginate (

@younes0
Copy link

younes0 commented Jun 28, 2016

@maxfarseer I have the same issue. Did you find a workaround ?

@maxfarseer
Copy link

@younes0 no :(

@AdeleD
Copy link
Owner

AdeleD commented Jun 29, 2016

Which version of react-paginate do you use?

@younes0
Copy link

younes0 commented Jun 29, 2016

2.1.1

@EllisMin
Copy link

You can use forcePage property instead of initialPage to watch for changes

@MLazarevic36
Copy link

You can use forcePage property instead of initialPage to watch for changes

Also, make sure that your prop is parsed as int 😄

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

No branches or pull requests

6 participants