Skip to content
Discussion options

You must be logged in to vote

you can return whatever you want from getNextPageParam or getPreviousPageParam - it doesn't have to be a number. So you can include the paging direction, something like:

getPreviousPageParam: (firstPage, pages) => ({ searchBefore: firstPage.headers["searchbeforetoken"] }),
getNextPageParam: (lastPage, pages) => ({ searchAfter: lastPage.headers["searchaftertoken"] })

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@TkDodo
Comment options

@niemyjski
Comment options

@niemyjski
Comment options

@TkDodo
Comment options

Answer selected by niemyjski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants