DEV Community

Discussion on: What makes React JS so popular?

Collapse
 
valeriavg profile image
Valeria

React is not faster nor lighter than other framework, actually quite the opposite: React has lots of caveats and pitfalls to avoid.

Also it's not hard to work with actual DOM at all, it's inefficient to render whole DOM tree on every change, so React instead offers an in memory model that tries to minimise redraw - the virtual DOM.

It's worth mentioning that React is not limited to web dev, and instead aimed to be platform independent, allowing to use it in mobile development or even server side. Such universality comes at a price: it's heavy (especially react-dom, which is unavoidable for web as you might have guessed).

This fact was the main reason for Preact: which is aimed exclusively at web development and therefore doesn't need that amount of abstraction.

And one last thing, when React just appeared it did not have nice and easy JSX, instead you were supposed to write createElement('h1',{...props},'Hello world!).

React became popular because of JSX. It was so nice to write dynamic components with html and assign scoped values and event handlers to elements without exposing globally that developers we ready to sacrifice a bit of speed and learn how to avoid React-specific mistakes.