T
TanStack•3y ago
other-emerald

Using the exact useQuery() hook multiple times in sibling components.

Is it fine to call the exact same useQuery() hook in multiple sibling React components ? Or is it a bad practice and I should call useQuery() only once at the parent component and pass the data into the children components ?
2 Replies
genetic-orange
genetic-orange•3y ago
It is totally fine and designed to be used that way! useQuery will immediately return data from the cache if it has already been fetched, and when it changes each component will receive the new data!
other-emerald
other-emeraldOP•3y ago
@julien TX for the confirmation 🙂

Did you find this page helpful?