Declare type of useQuery with initialData
I have a custom hook that is defined as follow:
Unfortunately, our linting rules require for all functions to have a type defined
When I use the
UseQueryResults, this does not considers that initialData is being provided, hence when accessing data from the hook, this is defined as Todo[] | undefined.Do you know how else I can define the hook type so that it knows data is always an array?
Thanks!