Closed AshuInsideOut closed 2 years ago
<button onClick={() => setActivePage(1)}>Change</button>
When I click this button nothing changes.
Hi @AshuGuptaGamer,
Could you provide a running example in a GitHub repo / CodePen / JsFiddle?
Also: do you have any message on the console? Can you console.log
the pageCount and
activePage` just before the render?
Oh, yeah it worked. I forgot to update the setItemOffset();
in the button. It works now thanks for the help :)
Hey, I have tried every way and I am not able to use useState hook to change the page using a button.
Is there something I am doing wrong?