Subjectively I am extremely in opposition to the fact that XML anything with composable functions is more intuitive than HTML templates by any stretch of the imagination.
That makes sense, but that's not what react does. Components are functions of their "prop"s. The rest of the state comes from a memoized cache in a fiber. Which fiber? That's determined from a reconciliation algorithm. Does it do the right thing? Usually.
You can tell if it's "a function of state" by whether the state is in the parameter list.
Hard disagree. React became popular because it was much better than its predecessors like Backbone, and also better than its contemporaries like the first Angular. I was still learning JavaScript, when I was doing a browser app for my thesis, and I used Backbone as a framework. Awful experience, using React was much more intuitive. While Backbone was imperative, React was declarative, with composable components, no custom HTML template syntax. Using React made web development fun for me.
> extremely in opposition to the fact that XML anything with composable functions is more intuitive than HTML templates
And I hate HTML templates. I think there are just two groups with different preferences and therefore it's somewhat useless to argue about this stuff.
I like to argue about it because I like knowing why people think the way they do about React. I'm a long-time React hater and still look for ways to change my mind, so there's a point for me I guess?
Why javascript, though? That preference, again, seems based on what you’re used to.
The actual goal is to manipulate the DOM based on state changes using a declarative representation.
Javascript seems more like something that was available rather than a good fit. (In fact, they felt like it was a bad enough fit that JSX had to be added to the mix.)
Setting aside any particular framework, HTML seems like a better fit to me… it’s inherently declarative and, of course, has a well understood, well supported relationship with the DOM. Extensions to bind state can be pretty well contained.
Why would I choose to write html in js over writing it in html?