0

When I load page with url zbcxyz?page=3. I get params page with searchParams.get("page"). I want to set selected page = 3. Tks enter image description here enter image description here I tried using focrePage but it didn't work

mindev
  • 3
  • 2

1 Answers1

0

I think you need pass initialPage props

<ReactPaginate
      nextLabel="next >"
      initialPage={(parseInt(searchParams.get("page")) || 1) - 1}
      />
Thusithz
  • 736
  • 1
  • 12
  • 33
  • wow thank you, it working. But khi use it. console.log write `You should call navigate() in a React.useEffect(), not when your component is first rendered...` it issue? – mindev Apr 25 '23 at 06:13
  • Great ... I'm think it's related to another plugin. It will be issue when execute `navigate()` method on each rerender – Thusithz Apr 25 '23 at 07:30