fix(types): fix promise inference in useQueries #3493
Mergedartysidorenko(GitHub profile, opens in a new tab)merged 2 commits into
beta fromrefs/pull/3493/headmerged by TkDodo View on GitHubTkDodo approved these changes
TkDodo merged this5562cfa
TkDodo closed this
tannerlinsley added labelsreleased on @beta
- src/reactjs/tests/useQueries.test.tsx line 786@@ -776,5 +776,11 @@776776 expectType<QueryObserverResult<string, unknown>>(result4[1])777777 expectType<QueryObserverResult<number, unknown>>(result4[2])778778779- // Array as const does not throw error779+ // handles when queryFn returns a Promise780780 const result5 = useQueries({781+ queries: [782+ {783+ queryKey: key1,784+ queryFn: () => Promise.resolve('string'),785+ onSuccess: (a: string) => {786+ expectType<string>(a)
Sign in to join this conversation.
This pull request is being automatically deployed with Vercel (learn more). To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/tanstack/react-query/5MXumaLSNDFG8ovPuEH8yEo61p5K ✅ Preview: https://react-query-git-fork-artysidorenko-issue-3483-tanstack.vercel.app