Hacker News new | ask | show | jobs
by farthenfurter 3499 days ago
Right - DOM diffing is the key selling point of React. But the fine-grained screen updates possible via DOM diffing is not super important for most applications.

Event system is already supported by DOM. React doesn't add anything there. Component lifecycle is also not compelling.

1 comments

That's kind of what I'm saying. If you don't value those things, why introduce a library at all? What you're describing can be implemented in < 10 lines.
More like 200 lines, so it is useful to have a library. BTW it is rare to hear component lifecycle and event system described as key selling points of React. Most people would say DOM diffing and perf are the key selling points.
The point of React is to make it practical to structure view logic as a function (projection) of the application state. Virtual DOM is just an implementation detail.
By the way, for the most minimal diffing implementation see https://github.com/patrick-steele-idem/morphdom.
I lied. More like 5 lines. http://codepen.io/anon/pen/MbjLMB