T
TanStack2y ago
absent-sapphire

Usequeries results referencing

In all the examples I have seen the useQueries function references results by number. Is it possible to acces results by query key also? Something like const dataInfo1=results['info1'].data; const dataInfo2=results['info2'].data; This would dramatically improve readability if it were available, I believe. Thanks.
1 Reply
fascinating-indigo
fascinating-indigo2y ago
no, its not possible. the array can be dynamic, we just keep the order, and keys can be array as well. what you can do is use combine to transform into an object with keys if you want

Did you find this page helpful?