Re:JavaScript for People Who Hate JavaScript
by w4tson on Wednesday August 09, 2017 @05:01PM
(#14973569)
No but writing HTML directly in your class is soooo late 90s like when we used to write Java Servlets!
All this has happened before. It will happen again
Re:JavaScript for People Who Hate JavaScript
by hajile on Wednesday August 09, 2017 @05:50PM
(#14974032)
You write syntactic sugar <div className="foo">abc</div> to turn into React.createElement('div', {className:'foo'}, 'abc') which generates an object {...stuff, tag: 'div', attrs: {className: 'foo'}, children: 'abc'}. Your final object is then compared to the previous object and any differences are manually written to the DOM in an efficient order.
Hardly comparable to Java Servlets.
[0] https://en.wikipedia.org/wiki/Fold_(higher-order_function)