`useQuery` not working?
is it just me or does
useQuery
not work in my next js components?
i try to call it and it says client[procedure] is not a functionSolution:Jump to solution
Only applies if you're using t3 with app router:
If you're trying to use API in a client component then API needs to be imported from /trpc/react
If you're using API in an rsc or anything on the server, you import from /trpc/server...
9 Replies
Are you using t3 stack? Make sure you're importing API from the correct file if you're using app router
the correct file?
Solution
Only applies if you're using t3 with app router:
If you're trying to use API in a client component then API needs to be imported from /trpc/react
If you're using API in an rsc or anything on the server, you import from /trpc/server
omg that explains so much
where did you get that info? i don't see anything like that in the docs since it's all pages router 💀
Theo's vid on the app router release for t3 explains it
And also you can't use hooks inside rsc, so it'd just fail on that account
rsc = react server component?
Yes
Here, give this should explain it:
https://www.youtube.com/watch?v=PmBfq-SpzCU
Theo - t3․gg
YouTube
This took us too long, I'm sorry
GITHUB LINK https://github.com/t3-oss/create-t3-app
So proud of the entire Create-t3-app team for this massive ship. The T3 Stack has never been better. APP ROUTER IS HERE.
Check out my Twitch, Twitter, Discord more at https://t3.gg
S/O Ph4seOn3 for the awesome edit 🙏
tysm!