top | item 39355153

(no title)

robador | 2 years ago

I think it's great they did what works for them. Personally though, I am starting to believe React, or indeed any reactive framework, is extremely ill suited for most websites. It adds a layer of complexity on many levels that IMHO is not worth the tradeoff. Not only the amount of tooling required (node_modules), also the fact that you're expected to write all your own elements (components) and override default browser functionality, and expect all of that to work perfectly (forever) is baffling to me. React is an extremely complex layer that abstracts away a quite simple and well understood concept: markup. If your content is mostly static, just use markup and sprinkle a bit of js on top of you must. Your visitors will be grateful. If you're building a web based application, which you're probably not, use React.

discuss

order

davnicwil|2 years ago

> just use markup and sprinkle a bit of js on top if you must

My perspective is of React as a templating engine for markup that allows you to add behaviour on top as you need. So in a sense, exactly what you've said.

It's good at this because it's all done seamlessly in the same language with hardly any magic or conventions they have invented. It's just javascript. It also has a rendering model that's extremely simple to reason about when updates happen.

You can build something as complicated or as simple as you want with that, of course, but React doesn't care if you do. That's up to you to decide. React can be 'just' a static markup template engine running at build time (my own blog is built this way!), a server-only template engine, little bits of behaviour sprinkled in on the client to isolated parts of the page, all the way up to a full blown client application with an arbitrary level of complexity.

maelito|2 years ago

> the fact that you're expected to write all your own elements (components) and override default browser functionality

What ? I've certainly not overriden the HTML div, nor the CSS font-weight.

austin-cheney|2 years ago

Agreed. This a problem that only needs to be solved once. My personal website is an OS like GUI that took a fair amount of effort to extract from an unrelated application, but no greater effort than starting from scratch with something like React. That effort is over and future contributions are now little more than a line of text in the HTML but I get all the flexibility and performance of not using React.

maelito|2 years ago

> If your content is mostly static, just use markup and sprinkle a bit of js on top of you must. Your visitors will be grateful. If you're building a web based application, which you're probably not, use React.

This is solved by React server rendering or RSC, e.g. through Next.

Your visitors will see HTML.

bilekas|2 years ago

> This is solved by React server rendering or RSC, e.g. through Next.

You realise that's just HTML with more steps?