useInfiniteQuery returning Old data #6766
Answered
by
firaki12345-cmd
firaki12345-cmd
asked this question in
Q&A
-
hi so i have my code below, that when the varaible color_name changes it passes that variable to the initialpageparmas so for example when the color_name = "black", it fetches all the data related to black but when i dynamilly change it to pink. it still feteches the old Black color data i tired using useEffect, still it uses the same color_name = black and not pink my code below
|
Beta Was this translation helpful? Give feedback.
Answered by
firaki12345-cmd
Jan 26, 2024
Replies: 1 comment
-
ok found the SOLUTION, i just had to pass the variable to the queryKey
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
firaki12345-cmd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ok found the SOLUTION, i just had to pass the variable to the queryKey
queryKey: ['colored',color_name],