Maybe the author has worked in different React codebases than I have, but in my experience, we use built-in browser functionality unless we have a reason not to. Maybe I've just been lucky?
Maybe the author has worked in different React codebases than I have, but in my experience, we use built-in browser functionality unless we have a reason not to. Maybe I've just been lucky?
The point is that the flavor "HTML Web Component" does not rely on JS to start rendering, unlike React.
A popular app that some web developers here may use day-to-day recently is Figma, which uses WebGL for rendering.
A variation could be the rendering of a partial UI whilst you then fetch data client-side. Even in this case the web component has the advantage as no JS is needed to render the initial UI.
<special-image>
<img src="/example.png" />
</special-image>This image will render before the JS is executed, so you've got no blockers and a perfectly fine fallback, then with the web component you enhance your image with whatever JS you want.
React (rendering in the browser, not server side): Page Load -> Component Load
vs.
Web Component Page Load -> Default Render -> Component Load
So if someone has JS disabled they would still see SOMETHING for the web component vs. nothing in React. And with JS they could get to some further render state.
[0]: https://react.dev/reference/react-dom/components/common#reac...