Re:Behavior Belongs in the HTML
by hifreq on Monday December 11, 2023 @08:14PM
(#38607900)
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.
[ Parent
| on HN ]
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.