conlonj25
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
Anyway, I have another fix I can use. Cheers for taking a look!
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
Ok, not the safest assumption I guess. It's just weird. It seems like a perfectly legit use of everything.
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
I assume once I have a proper user object I have a green light to go ahead and execute any protected procedures?
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
So that first console.log actually returns my logged-in user object
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
Sorry,
some user data
is just a placeholder for a legit user object. I didn't wanna dox myself.13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
So, if I console.log the user data in each function:
- My React Component (MyHabitsContainer)
console.log("CLIENT SIDE", session?.user);
- My TRPC procedure (getByUser) console.log("SERVER SIDE", ctx.session.user);
- TRPC protectedProcedure (src/server/api/trpc.ts) console.log('PROTECTED PROCEDURE', ctx.session?.user);
I get the following logs for a single page render. In this order.
13 replies