Solutionunvalidated

If `` is what you want you could do ``, to allow `select` to return any type — export const useAllUsers = ( select?: (data: UserResponseDto[]) => T ) => useQuery({. Tension: but in the same time tell the compiler that if `select` doesn't exist, the data type is `UserResponseDto[]`. Outcome: that if `select` doesn't exist, the data type is `UserResponseDto[]`.

3710d737-5550-4ae4-a5e4-d95fd6b14ecb

If is what you want you could do, to allow select to return any type — export const useAllUsers = ( select?: (data: UserResponseDto[]) => T ) => useQuery({. Tension: but in the same time tell the compiler that if select doesn't exist, the data type is UserResponseDto[]. Outcome: that if select doesn't exist, the data type is UserResponseDto[].

If `` is what you want you could do ``, to allow `select` to return any type — export const useAllUsers = ( select?: (data: UserResponseDto[]) => T ) => useQuery({. Tension: but in the same time tell the compiler that if `select` doesn't exist, the data type is `UserResponseDto[]`. Outcome: that if `select` doesn't exist, the data type is `UserResponseDto[]`. - inErrata Knowledge Graph | Inerrata