Live data from Hacker News

Does anybody like React?

jsx.lol

11–20 of 353 posts

Re: Does anybody like React?

#11
post #8

I like React. And I have seriously tried the HTMX/Hotwire camp. I wanted to make a back button use browser APIs to go back if the coming from the inbox, just link to the inbox otherwise to preserve scrolling. I had to wire the actions from the html to call the function that goes back, then in my controller determine the previous page and send the JS enabled back button or the hard link. My logic was spread out over 3…

I know there will probably be some complications here and there, but this could be done with Web Components too, right?

Re: Does anybody like React?

#13
post #8

I like React. And I have seriously tried the HTMX/Hotwire camp. I wanted to make a back button use browser APIs to go back if the coming from the inbox, just link to the inbox otherwise to preserve scrolling. I had to wire the actions from the html to call the function that goes back, then in my controller determine the previous page and send the JS enabled back button or the hard link. My logic was spread out over 3…

> I wanted to make a back button use browser APIs to go back if the coming from the inbox, just link to the inbox otherwise to preserve scrolling. I had to wire the actions from the html to call the function that goes back, then in my controller determine the previous page and send the JS enabled back button or the hard link.

This is why I hate react spas. They're always trying to find some stupid way to break my browsers back button and navigation buttons.

I will always prefer htmx/server rendering with native everything (except the occasional form boosting.)

Re: Does anybody like React?

#15
As someone who lived through all major waves of JS for the last ~16 years, I do love react, in a sense:

React is the worst JS framework except for all the others we've tried.

I'd take React over the Angular 1 days any time. I'd take Angular 1's full-bodied MVC over the "build it yourself from scratch every time" approach of Backbone. I'd take Backbone's minimal MVC structure over the classic JQuery Soup architecture. And I'd take JQuery's dom manipulations and standard-library improvements over the native apis (of that era) in an instant.

React has its tradeoffs, but we got here after a long slog of other things that don't work.

Re: Does anybody like React?

#16
React is great honestly. It's a simple mental model. Hooks are fun and compose well. JSX makes sense: Astro is a great example of how something that is certainly not react still has react-like syntax and is immediately accessible to anyone with react experience.

Re: Does anybody like React?

#19
I like it, but only in its truest sense: A view library. Various parts of the ecosystem are horrible even if they don't pertain to react. I like jotai because its elegant as a global state library (React context has too much boilerplate).

But the thing is, React and others is useful only for a few specific cases, IMO. I would only feel the need for them if we're building truly interactive applications (Open Street Map, figma, a text editor,...), but only because they've taken care of the state management boilerplate (even if you're now boxed by their applications. But most apps on the web don't needs to be an SPA. They can actually be improved by being a multi page application with small islands of interactivity.

Re: Does anybody like React?

#20
I like React.

I made sure that all of the interactions in our app that don't require a server round-trip are instant, without any annoying undead skeletons and animations. This works really well because we keep most of the data in RAM on the client, with IndexDB as the backing store and a custom synchronization protocol.

I avoided the "server-side rendering" out of a general distrust of "magic" solutions that do everything for you.

React itself is also really straightforward as a mental model of rendering.

Post reply on HN