Re:Astro 1.0 – a web framework for building fast, content-fo...
by munbun on Wednesday August 10, 2022 @09:48AM
(#32411862)
JSX is much easier to maintain than pretty much every other templating language.
If you are building a growing design system with any degree of complexity, React is one of the best tools available.
Re:Astro 1.0 – a web framework for building fast, content-fo...
by dsego on Wednesday August 10, 2022 @06:37AM
(#32409920)
Which looks nicer? Eta vs JSX
<%~ includeFile('./navbar', { pages: [
'home',
'about',
'users'
] }) %>
<navbar pages={['home', 'about', 'users']} />
> would just be JavaScript functions that take props and return some JSXThey can also be async functions that process data independently. Whereas templates are commonly just passed in data from the controller.
But React (like Vue and Svelte) are fundamentally about interactivity. If I had a project where I knew for sure that I only wanted to generate HTML sans JS on the server (or with a static build process) I wouldn't even consider using React.
It barely even makes sense. Your "React components" would just be JavaScript functions that take props and return some JSX. None of the interesting React features and hooks would even make sense, other than maybe context (and presumably most or all popular static HTML templating tools have comparable features).