5 ms·
React does everything wrong: vDom, components rendering multiple times instead of once then reacting to changes, manual memoization techniques. Hence why Svel
by dham 4y ago
React does everything wrong: vDom, components rendering multiple times instead of once then reacting to changes, manual memoization techniques. Hence why Svelte and Solid are not only have a better dev experience, they're also much, much, much faster and eventually will take over React as it will go the way of jQuery, Knockout, Backbone, etc
- v0idzer0 4y agoSvelte is already 6 years old and nowhere near competitive with React in terms of popularity
- cercatrova 4y agoAnything that has me write in templates in HTML like it's PHP is a no go for me. JSX reigns supreme for a reason.
- camgunz 4y agoI've built apps in both react and svelte, and I personally don't see a significant difference between them HTML-wise. .map vs each isn't a big deal, especially when you're usually constructing whatever you're iterating over anyway, etc.
- jmull 4y agoSo… JSX isn’t another HTML templating mechanism?
- cercatrova 4y agoJSX is pure JS, unlike other templating languages.
- solardev 4y agoWhat does this mean? It's certainly not vanilla JS/ecmascript. It's closer to XHTML than JS.
- cercatrova 4y agoJSX is just syntactic sugar for React.createElement [0]. This means that I can write any valid JS I want in there. For example, if I use a functional programming library with a match statement, I can have that in my JSX, I don't need to adhere to what the templating authors came up with. [0] https://fettblog.eu/jsx-syntactic-sugar/ https://fettblog.eu/jsx-syntactic-sugar/
- solardev 4y ago...but what does React.createElement compile down to? HTML and JS. Whether you do it with a clientside runtime or a serverside render, it still gets compiled or transpiled down to DOM objects in the end. I think of "pure JS" as something more like a standalone node function that takes an input and gives you some abstract data output, vs templating code whose main purpose is to define elements in the DOM. That you can intersperse with JS with DOM-like props in a JSX component (styles, states, handlers, whatever) doesn't mean that JSX isn't a templating language. It's just one that also accepts inline JS. Hell, you can do that with PHP and heredocs/template literals. Aren't all templating languages "syntactic sugar"? Isn't that their point?
- jmull 4y agoYeah, it’s (language) integrated with a convenient HTML syntax… just like all the HTML templating languages. (language) could be JavaScript as far back as 2000 as far as I know (ASP) — probably earlier and I just hadn’t heard of it.
- funstuff007 4y agoIs JSX the prime driver of React's success? Even, ignoring the big corporate backing, I'm not sure this is the case.