useMutation
and useQuery
hooks should be grouped by domain/feature in a single location: features/lib/feature-hooks.ts
. Never call data fetching hooks directly from component bodies.
Benefits:
.tsx
filesinvalidateQueries
over passing refetch
functions between components. This approach is more maintainable and easier to understand.