Dyanmic Query Keys with React Query #6366
Unanswered
thusithagh
asked this question in
General
Replies: 1 comment
-
show a reproduction please. not sure if this is just a typo but:
you're using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this situation where I have to generate query keys to be used by react query.
const datesToRequest = ['2023-11-01', '2023-11-02', '2023-11-03']
Above is actually dynamically generated. For the ease of explaining I've hard coded it.
fetchVehiclesByDate
will call to the server and return some data. However, thefetchVehiclesByDate
function is not seems to be getting called.It works only when I have the query key is hard coded like below:
Any idea on how to get this working for my case?
Beta Was this translation helpful? Give feedback.
All reactions