Adding Custom Headers in trpc using local storage
Hey all, I'm trying to get add custom headers on the client side api of trpc, but have been struggling to do so.
Right now the setup currently looks like this
This doesn't work since the
trpcClient
gets initialized before the header
does in useEffect
and there doesn't seem to be a way to update the headers via the trpcClient.
Any advice would be apprecited!2 Replies