Hacker News new | ask | show | jobs
by hifreq 915 days ago
If the choice is between using HTML in JS (e.g. JSX) vs using JS in HTML (essentially, that's what HTMX is), my choice is unequivocally the former. Ignoring some very basic use cases, UI apps are all about state and interactivity. HTMX can somewhat handle interactivity (very awkwardly in my opinion), it offers nothing over React in terms of state management.
1 comments

In terms of state management, it's a bit of an apples-to-oranges comparison, no? It offers nothing over React because it doesn't offer any state management. AFAIK HTMX is a wrapper for the fetch function that lets you define your request from your HTML. How you manage the state on the server is up to you.
That's where I disagree with this approach. IMO sending over fully rendered views just because some state changed is antithetical to the UI needs. UI is the state that users interact with.