3 ms·
React can be used without JS or by hydrating subtrees but those are very uncommon. It’s certainly not React’s “happy path”.
by afavour 3y ago
React can be used without JS or by hydrating subtrees but those are very uncommon. It’s certainly not React’s “happy path”.
- kamikaz1k 3y agoLiterally just a single API call: renderToString https://react.dev/reference/react-dom/server/renderToString https://react.dev/reference/react-dom/server/renderToString
- afavour 3y agoYes, I’m very aware, but renderToString is designed for later client side hydration. To make your point you would have wanted to cite renderToStaticMarkup, but tellingly no-one ever does.
- eyelidlessness 3y agoRendering to static HTML is actually pretty common. Admittedly, hydrating subtrees is fairly uncommon (at least where the full tree is also rendered by React server-side), but it’s well within the “happy path” and both patterns have been heavily promoted by React from very early on. What’s not within the “happy path” is automating any sort of partial hydration process, which is unfortunate, but it seems pretty likely RSC is going to subsume that use case for most anyone trying to solve it with React.