Closed
Description
As shown in the docs, this correctly errors:
const useTodos = () => {
const { data: todos, ...rest } = useQuery({
queryKey: ['todos'],
queryFn: () => api.getTodos(),
})
return { todos, ...rest }
}
but this does not:
const useTodos = () => {
const query = useQuery({
queryKey: ['todos'],
queryFn: () => api.getTodos(),
})
return { ...rest, data: data[0] }
}
It would be great if any destucuring in the same scope could trigger the violation. Is that possible @Newbie012 ?