select function in useQuery only gets called on initial #1682
Unanswered
Jake-Prentice
asked this question in
Q&A
Replies: 1 comment 4 replies
-
However, we're having a discussion over here: #1639 Feel free to chime in with your input :) |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to use the select in the useQuery so that I can filter my data a bit, I'm looping over an array and in the nested array is what I want the data to be, however when the index of the selected item changes, the select doesn't rerun, so I'm left with the previous data. It never updates.
The code:
const {data, ...} = useQuery("quizzes", fetchQuizzes, { select: quizzes => quizzes[selectedQuiz.index].verbs });
what I want is that the select gets rerun everytime the selectedQuiz.index changes. Am I doing something wrong?
Beta Was this translation helpful? Give feedback.
All reactions