T
Join ServertRPC
❓-help
How can you fetch data on a dynamic router with trpc?
I’m creating a table component within my NextJs app. Instead of making an api call in the parent component and passing the data to the table through props I’d like the component to be able to manage its own state. How can I achieve this in trpc v10?
In v9 I believe you could do
What’s the equivalent, if there is one, in v10?
In v9 I believe you could do
const helloNoArgs = trpc.useQuery(['hello']
What’s the equivalent, if there is one, in v10?
v10 still has the react-query integration. Have you read the migration guide?
I did not. I entered trpc on v10 so I apologize, but thank you!
Is there a particular module that I need or should the below implementation work out of the box
useQuery(['post.byId', '1'], {
trpc: {
context: {
batching: false,
},
},
});
trpc.post.byId.useQuery('1', {
trpc: {
batching: false,
},
});
This works just fine, but I'm creating a component that is responsible for it's own data and this is specific to 1 case
The console tells me
missing queryFn