Hey, have you taken a look the rick and morty example, it does exactly what you are looking for, the Episode route handles that as it fetches the data for the episode with a unique id that depends on the episode's id, any subsequent load of that episode will only trigger silent refetch in the background, you can take a look at how the characters was prefetched for a more complex example. Does this help you?
Hey thanks! Following up, I converted our dashboard components to use react-query as they were the perfect candidates for it, and it is amazing. I still need to understand exactly how the keys work to refresh data when you pass an object as a key - assuming it's converted to a string under the hood. But it's working great.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, have you taken a look the rick and morty example, it does exactly what you are looking for, the Episode route handles that as it fetches the data for the episode with a unique id that depends on the episode's id, any subsequent load of that episode will only trigger silent refetch in the background, you can take a look at how the characters was prefetched for a more complex example. Does this help you?
Hey thanks! Following up, I converted our dashboard components to use react-query as they were the perfect candidates for it, and it is amazing. I still need to understand exactly how the keys work to refresh data when you pass an object as a key - assuming it's converted to a string under the hood. But it's working great.