Is it possible to run code if and only if a useQuery resolves successfully?
Original message was deleted
useQuery conditionally, use enabled: instead (you're breaking the "rules of hooks" here)useForm to another component and render it with the result of the data after the query has settled, so you know the defaultValues before the render and don't need the effectonSuccess-callback on the useQueryenabled: false to enabled: !!playId and because trpc usequery doesn't understand this completely you can set the value you pass in playId ?? '' .as string ! at the endenabled:defaultValuesenabled: falseenabled: !!playIdplayId ?? '' as string