T
TanStack14mo ago
vicious-gold

Is a single router created for a given SSR pass?

I have state global to a render (but not module-global, I don't want other requests to use it) that I want to share between suspense boundaries, nested routes, and anything else that might correspond to a single initial page load SSR. My state happens to be a timestamp: I'd like to pass each server-side fetch() call a shared header so an API server knows these requests are coming from the same overall backend request.
2 Replies
ambitious-aqua
ambitious-aqua14mo ago
creatRouter is called for every request for this very purpose.
vicious-gold
vicious-goldOP14mo ago
great! I hooked this up last week and am documenting it now and looking for limitations

Did you find this page helpful?