How to implement pagination properly #2683
Unanswered
ahmadxgani
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have concerns about implementing the pagination feature, I'm worried if I implement it in the wrong way.
and my concern became real when I encountered problems when switching indexes. here's my code
Pagination.tsx
useAPI.tsx
constant.ts
pagination.type.ts
in the
Pagination.tsx
, the children receive the result of fetched data, but the problem is, i have no idea how to revalidate/refetch in order to update the pagination arrayi try to add the conditional statement that show loading bar if the data isn't already, but that cause my component to always render that loading bar since the
(data as T[])[activePage]
is undefinedany advice and feedback would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions