bigtechguy
bigtechguy
TtRPC
Created by bigtechguy on 8/17/2023 in #❓-help
useContext utils getData always returning undefined
I have my app set up with TRPC and when trying to call const utils = trpc.useContext(); const cart = utils.cart.getCart.getData(); The data always winds up as undefined even though I can see the data populated in the query cache. Is there any special gotchas with using these utils?
"@trpc/client": "^10.37.1",
"@trpc/next": "^10.37.1",
"@trpc/react-query": "^10.37.1",
"@trpc/server": "^10.37.1",

"next": "13.4.12",
"@trpc/client": "^10.37.1",
"@trpc/next": "^10.37.1",
"@trpc/react-query": "^10.37.1",
"@trpc/server": "^10.37.1",

"next": "13.4.12",
4 replies
TtRPC
Created by bigtechguy on 11/9/2022 in #❓-help
abortOnUnmount config error
I'm encountering an error when passing abortOnUnmount saying that it does not exist as a possible param. I'm basing this off the v10 docs. Am I missing something here? My implementation:
const [trpcClient] = React.useState(() =>
trpc.createClient({
abortOnUnmount: true,
links: [
const [trpcClient] = React.useState(() =>
trpc.createClient({
abortOnUnmount: true,
links: [
https://trpc.io/docs/v10/aborting-procedures
2 replies