Comment by hunterb123
5 years ago
We're not talking about React we're talking about JSX.
Svelte has a lot more going on than it's template language as well.
We're only comparing the templating system to JSX.
5 years ago
We're not talking about React we're talking about JSX.
Svelte has a lot more going on than it's template language as well.
We're only comparing the templating system to JSX.
Let's compare to JSX then: https://news.ycombinator.com/item?id=29194287
That's still React. JSX is only turning brackets, tag names, and attributes into function calls and object properties.
Special attributes, events, etc. are React specific and not related to JSX.
Basically it's a clean way to represent nested function calls, that's it. It has nothing to do with React nor does it need React.
<tag prop="value"/> gets turned into React.createElement('tag', {prop: "value"})
That's all. Period. The special props React introduces has nothing to do with JSX.
Also you can customize JSX to change the functions it generates. (i.e. swapping out React.createElement)
https://news.ycombinator.com/item?id=29206956
Those are all features of React or the React JSX transform, not JSX. Other JSX transforms or frameworks using them may or may not share any or all of them. (JSX is not only used in React.)
Ah. So we're comparing a specific templating language (Svelte) with an idealized and nonexistent version of JSX (JSX is a non-standard extension that has different flavors depending on what underlying framework, and versions of a framework, you use).