andy
SSR with Client Components
okay, for the sake of not installing another dependency, i'm just gonna store a global WeakMap, and instead of the SSR context storing the headers directly, they store an object which can be accessed in the server only WeakMap
14 replies
SSR with Client Components
I finally managed to find an (incredibly janky) solution:
- A server component runs
await headers()
and then passes it into a client component that then passes it into a context
- The TRPC client reads said headers
I feel like this should be listed somewhere on the docs.14 replies