Skip to content
Discussion options

You must be logged in to vote

how can I set initial state(pageMetaData) to previously fetched page / filters if there was a previous query?

I think initialData is what you want to initialize a query with some data that already exists in the queryCache at another key: https://react-query.tanstack.com/docs/guides/initial-query-data#initial-data-from-cache

FYI, usePaginatedQuery will be removed in v3, you can just set keepPreviousData on useQuery: https://react-query-beta.tanstack.com/guides/migrating-to-react-query-3#usepaginatedquery

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tannerlinsley
Comment options

You must be logged in to vote
0 replies
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