Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't think I could write a comment that's a stronger explanation than what Guillermo Rauch wrote:

https://rauchg.com/2015/pure-ui

TL;DR: It's not about the HTML in Javascript; it's about being able to declare all the states of your UI in a stateless way. The result is that React components are like pure functions: you pass them inputs and you get predictable outputs.



You can do that with other solutions, its not limited to react. I use polymer but you can use it with vue or others.


True, but that's aside the point. React, along with others, exists to solve an architecture problem that regular HTML/CSS/JS is notorious for.


If it's about state I feel like ExtJS is a better alternative especially with the way it handles Controllers, Events, and "Components" with state.


We use ExtJS a lot. But I think the exact opposite is the case. With ExtJS, you have the usual double-binding, e.g. if you set this property of that Model somewhere in your view hierarchy some little snippet of HTML are inserted/removed from the DOM. It's basically side effects only.

If I understood it correctly, one can think of react app/page as a pure function taking data and producing a DOM.

Reasoning and testing pure functions should be much easier than a set of components which partly rely on side effects.


I've used both React and ExtJS. Overall React is much easier. ExtJS becomes a mess of event handlers, just take a look at all the possible events when working with their trees. In theory it looks great, in practice it's hard to follow the code and performance is terrible. The two way binding causes all sorts of headaches including the usual remove listener, update model, add listener type code. It's difficult to follow what code updates what part of the DOM. With React I only need to look at a component's render function. Same with the component's state.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: