To support the RSC context, all React needs to do is allow exporting getServerTreePath, and the rest can be done in userland.
React already has `currentlyRenderingTask` internally. Can't fit the whole patch in a screenshot, but you get the gist.
The nice thing about _document was being able to control the post-app render. You could collect things from the tree render in a single place to add to the head (react-helmet), body, etc.
I give you: onBeforeInitialFlush, insertHtml, insertSlotHtml, <RenderSlot>, and more!
Replying to @timneutkens
My bad, this is kind of what I gathered from v0, which reads a bit differently.
Still, you're confirming it's nowhere near the roadmap, which isn't great.
Not every use case should be supported upstream, which is the whole point of providing lifecycle hooks.
This Twin Peaks day hits harder than usual… #TwinPeaksDay 🥲
It's great that this works for event handlers.
It'd be amazing if this could work for ref functions, too (it currently doesn't) 😞
Maybe I'm alone with this, but I prefer to reference status codes by their names or "reasons" instead of the code number. Pretty please @nodejs 🙏

















