Passing URL Params to TRPC causes Error on First Render, as URL-Param is undefined
I am not sure if I am missing something, but I can't get this to work. I am getting some
id
passed down in my url params, and I want to pass down that id to trpc, to fetch some data from my database:
Now the problem seems to be that id
isn't there on first render: the router will first have to get it etc., so I get a TRPC Client Error, as id
at this time is undefined
What am I missing here?3 Replies
its correct tho
you should enable the query only when the router is ok
when isReady is true, the router is fine to query with
omg, thank you so much. really love this community for stuff like this!! i had done this before and shouldve known but somehow felt stuck
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View