Javascript – Need help. setState doesn't work in next.js
I am trying to change the page number with setCurrentPage(page) but as I click the button, the state doesn't change at all. Tried different approaches but nothing worked. Tried changing the number in useState(1) manually and verified the page changes.…