Skip to content
Discussion options

You must be logged in to vote

I was thinking about the case and found that initialData was being provided even though the queryKey had changed when I modified the filters. It was confusing because initialData was being provided from custom hook, and I haven’t thought about it hours ago.

export function useCharacterRanking (
  { 
    // ...
    ...options
  }: UseInfiniteQueryOptions<RankedCharacter[]> = {}
) {
  return useInfiniteQuery<RankedCharacter[]>(
    // ...,
    // ...,
    options
  )
}
useCharacterRanking({
  // ...
  initialData: rankingData
})  

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@zero734kr
Comment options

Comment options

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

@zero734kr
Comment options

Answer selected by zero734kr
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