Nested TRPC Calls
Hi, would anyone be able to assist please? Hope it's ok to post stack overflow link, just figured code would format better. I'm trying to call a TRPC method within another, but get invalid hook call. Essentially trying to modify returned products with s3 image url's being returning back to the component. https://stackoverflow.com/questions/76232392/nextjs-trpc-invalid-hook-call-nested
Stack Overflow
I've got nested TRPC calls, and when I do this, it throws 'Invalid hook call' in the console of the server. The end goal is, I'm pulling product info from a database, and then looking up the produc...
Solution
useQuery and useMutation are hooks so you can only call them from within React components, and only unconditionally (ie no if statements etc before them)