Tanstack Router + React Query + Better Auth
I have a question, which one you prefer for dasboard app?
1. prefer using useSession on every component that require user data
or
2. prefer using getSession and wrap it with react query in root beforeLoad then put it on root context so i can access it on every component? then when i need to update user/session i invalidate the query
on `root`
on login action / any related with changing user/session data i call refetchSessionQuery()
refetchSessionQuery function
then on every page i just use it like this