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 know this doesnt fit here but im entering desperation mode with the behavior im having.
Im trying to implement server side pagination using react query at v3 and react table at v7. Im trying some things and created a custom paginator because I want not seeing the virtual paginator from the table but now when I change the custom made paginator, the other appears and it seems I created a paginator inside a paginator..
In react-query v3 I used useInfiniteQuery to fetch the limit and offset:
The custom buttons I created just for testing but they are part of the bug. The built in paginator only shows when I change the state on the manual. So on the first page I dont actually see the builtin paginator. It seems im creating a pagination inside a pagination at this point
Anyone had any idea of what I am missing and what could be causing this weird behavior of having a pagination inside a pagination?
Another thing I tried was having an useEffect but this ends up making calls and see the built in paginator growing on pages (correctly, but not what we want)
// React.useEffect(() => {
// const data = devicesData?.pages
// console.log('datadatadatadata', data)
// if (hasNextPage) {
// fetchNextPage()
// }
// }, [hasNextPage, fetchNextPage])
I think i probably must change my useInfiniteQuery but at this point im a bit lost ngl.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I know this doesnt fit here but im entering desperation mode with the behavior im having.
Im trying to implement server side pagination using react query at v3 and react table at v7. Im trying some things and created a custom paginator because I want not seeing the virtual paginator from the table but now when I change the custom made paginator, the other appears and it seems I created a paginator inside a paginator..
In react-query v3 I used useInfiniteQuery to fetch the limit and offset:
On my component I call the hook:
And on page load I get:
If I change page on my custom paginator, the fields change to:
And the paginator built from react-table appears.
Rest of relevant code:
Inside the table I have a tab wi device status.
Call my table:
And the table with the hand made paginator (not supposed to be used):
The custom buttons I created just for testing but they are part of the bug. The built in paginator only shows when I change the state on the manual. So on the first page I dont actually see the builtin paginator. It seems im creating a pagination inside a pagination at this point
Anyone had any idea of what I am missing and what could be causing this weird behavior of having a pagination inside a pagination?
Another thing I tried was having an useEffect but this ends up making calls and see the built in paginator growing on pages (correctly, but not what we want)
// React.useEffect(() => {
// const data = devicesData?.pages
// console.log('datadatadatadata', data)
// if (hasNextPage) {
// fetchNextPage()
// }
// }, [hasNextPage, fetchNextPage])
I think i probably must change my useInfiniteQuery but at this point im a bit lost ngl.
Beta Was this translation helpful? Give feedback.
All reactions