T
TanStack3y ago
fair-rose

how to type-safely pass an argument to useQuery from a previous request?

Stack Overflow
how to type-safely pass an argument to useQuery from a previous req...
I have two custom hooks for using useQuery. The second hook depends on the result of the first While the first hook is being executed its data is undefined interface Props { id: number enabled:
1 Reply
conscious-sapphire
conscious-sapphire3y ago
I would merge them in a single useQuery: https://twitter.com/Julien_Delort/status/1628777914291392513
Julien Delort (@Julien_Delort)
@tan_stack query tip: when 2 endpoints are tightly coupled and you always need to call them both to get the data, you don't necessarily need multiple useQuery calls: #javascript #webdev #code #webdevelopment #programming #reactjs #react
From Julien Delort (@Julien_Delort)
Twitter

Did you find this page helpful?