nextui
nextui copied to clipboard
fix(react-pagination): add active page to memoized callback deps
Closes https://github.com/nextui-org/nextui/issues/619
📝 Description
Reading state in pagination's onChange will always return the initial value.
⛳️ Current behavior (updates)
Add activePage to the memoized callback deps.
🚀 New behavior
Update or changes if total, activePage (deps) has been changed.
Read more: usecallback.
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
Note The branch based on
next.
onChange donot work when it receive a new value, and param page cannot bind a react state