-
Hi Guys, I've just discovered react-query and I want to start using it in my system. I have one flow that it's a little bit complicated and I'll appreciate your help translating it to react-query.
Also, when I show the items (after the flow above) I want to use infinite scrolling for the next fetch. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Is the filtering done on the client ? ( Sounds like you could use the On the effect, you would look if there are less than 20 items, and if there is a next page before fetching the next page. Something like:
|
Beta Was this translation helpful? Give feedback.
Is the filtering done on the client ? (
.filter()
)Sounds like you could use the
useInfiniteQuery
to handle this, with an effect to handle the situation of less than 20 items.On the effect, you would look if there are less than 20 items, and if there is a next page before fetching the next page.
Something like: