AdeleD / react-paginate

A ReactJS component that creates a pagination
MIT License
2.76k stars 628 forks source link

Page active style issue - How to set page 1 as active? #493

Open gbaldeon opened 1 year ago

gbaldeon commented 1 year ago

I'm building a search results page. While changing the data and the pageCount property the paginate component doesn't update the active page.

I'm using 2 datasets.

Steps to reproduce:

  1. I load dataset-1 with the paginate component and assign the pageCount property.
  2. I select the 3rd page image
  3. I load dataset-2 with the same paginate component and assign the pageCount property.
  4. The paginate component still shows the 3rd page as active image

How to reset or set page 1 as active when I change the data?

Indranil-R commented 1 year ago

Hi, you can manually set the Page Index to 1 upon detecting any changes in your search component or when the input state changes

gbaldeon commented 11 months ago

@Indranil-R How can I set the page Index to 1? what props?

image

jbhall4291 commented 9 months ago

Have a look at the forcePage prop image