t
tRPC
t
tRPC
Using tRPC inside a react-location route loader
Original message was deleted
tRPC
Join
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,111
Members
View on Discord
S
sachin
•
11/19/22, 4:58 PM
const ctx = trpc.useContext();
const ctx = trpc.useContext();
has to go in the body of the component
, not a loader function
S
stiba
Yes, I understand that. My question was if it's possible to access the context w...
S
sachin
•
11/19/22, 5:06 PM
no
, it
's not
S
sachin
•
11/19/22, 5:06 PM
maybe you want
https://trpc.io/docs/ssg-helpers
S
sachin
•
11/19/22, 5:16 PM
is it possible to define your routes inside a component
?
S
sachin
•
11/19/22, 5:16 PM
they show that in the react location example
const
ctx
=
trpc.
useContext
();
const
ctx
=
trpc.
useContext
();