You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get a Vanilla JS implementation up and running and I made some good progress.
The table is created and rendered to html, including pagination buttons.
However, when calling nextPage() / previousPage() I try to update the state of the table but it seems not to be updated.
So when re-rendering it still renders always the first page.
Is this a bug in table-core or expected behavior and do I need to do something else to manage the state?
The reproducible example mentioned below is an easy setup and should be self explanatory.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
Terms & Code of Conduct
I agree to follow this project's Code of Conduct
I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
It's because you hardcoded the pagination state, instead of storing it in state. In your code, the pageIndex will always be 0, and the pageSize will always be 10. You're making it so it cannot change.
I'm guessing you meant to use initialState instead of state
TanStack Table version
v8.12.0
Framework/Library version
Vanilla JS
Describe the bug and the steps to reproduce it
I'm trying to get a Vanilla JS implementation up and running and I made some good progress.
The table is created and rendered to html, including pagination buttons.
However, when calling
nextPage()
/previousPage()
I try to update the state of the table but it seems not to be updated.So when re-rendering it still renders always the first page.
Is this a bug in table-core or expected behavior and do I need to do something else to manage the state?
The reproducible example mentioned below is an easy setup and should be self explanatory.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://stackblitz.com/edit/github-6xqt97?file=main.js
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
Maybe, I'll investigate and start debugging
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: