flat-fuchsia
flat-fuchsia15mo ago

useInfiniteList

Hello. I am using useInfiniteList, how do I make it so that when I load new elements, they are added to the beginning and not to the end?
7 Replies
kapa.ai
kapa.ai15mo ago
Hi @RomaY. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai15mo ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the useInfiniteList documentation (https://refine.dev/docs/api-reference/core/hooks/data/useInfiniteList) for more information on how to use this hook. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
useInfiniteList | refine
useInfiniteList data hook from refine is a modified version of TanStack Query's useInfiniteQuery for retrieving items from a resource with pagination, search, sort, and filter configurations.
kapa.ai
kapa.ai15mo ago
<@538717491908575242> kapa.ai is still learning and improving, please let us how it did by reacting below
flat-fuchsia
flat-fuchsia15mo ago
Because if I use const allPages = [].concat(...(data?.pages ?? []).map((page) => page.data)); then the elements are repeated, then I just make a map by pages and a map by page, but I can't sort the pages Who can help me?
genetic-orange
genetic-orange15mo ago
useInfiniteList | refine
useInfiniteList data hook from refine is a modified version of TanStack Query's useInfiniteQuery for retrieving items from a resource with pagination, search, sort, and filter configurations.
flat-fuchsia
flat-fuchsia14mo ago
Hello. is it client-side or server-side sorting? because I'm doing a chat and uploading new messages to the bottom, so my upload button is at the top, and I'd like them to just add from the top I found where my mistake was
genetic-orange
genetic-orange14mo ago
Hello @RomaY , I'm glad your issue is solved. Could you share the issue for future reference so if someone has a similar issue, it can be helpful?