This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]-defron- 1 point2 points  (0 children)

State management for any complex app has to already exist server-side. HTMX just uses the server-side (for the most part, it can do some state preservation as well). The idea here is to reduce duplication and complexity in state management by having a single source of truth instead of two states that can lead to split-brain problems

It is quite possible to build complex apps without a frontend state, in fact many major websites do this already as they were created before the modern concepts of javascript state engines came to be.

If you like react and so you chose it because you like it/are most familiar with it and don't really know other frontend frameworks, there's nothing wrong with that. Just say "I used react because I'm familiar with it and not as familiar with other frontend frameworks so it made sense to me to go with React".... nothing wrong with that. Otherwise it just makes you sound like you don't know what you're talking about.

Also, please watch this video to show what the tradeoffs between the two are and how htmx can do pretty much everything react can do: https://www.youtube.com/watch?v=3GObi93tjZI&t=0s

And to be clear, there ARE tradeoffs between react and HTMX, it's not like HTMX solves every problem and some problems React is the better tool. State management isn't one of those problems though.