Javascript landscape shits out frameworks like it’s nobody’s business. Svelte team recently came with SvelteKit. There are tools like Stencil. But, ReactJS only seems to be booming. In 2020, the React npm module had 4 times the number of installs as Vue.js, the second most common JavaScript framework. In 2020, front-end web development with React was a common theme, and it will continue to be so in 2021. What explains ReactJS’ popularity?
AngularJS vs ReactJS comprision
React owes its initial momentum to this comparison. A few cool kids seemed to have taken a liking to ReactJS’s way of doing things. ReactJS felt like functional JavaScript, it had borrowed functional programming concepts and functional programming was also gaining popularity at that time. A lot of people found React’s way of using a single direction flow of data instead of Angular’s two-way binding to be a much more sane way to reason about the state management. As a result of its popularity, a slew of libraries, tools, and ready-to-use components have emerged. After a while, React became the go-to library for creating user interfaces. After that, it really just snowballed from there, bringing us to our second point “Pool of available talent”.
Pool of available talent
It’s a no-brainer because React has a much larger reach, talent base, and support. For whatever reason ReactJS way of doing things caught on. A lot of people felt that angular was bloated. They were unhappy with breaking changes. The fact that Facebook claims to use ReactJs on their own projects also helped attract talent towards it.
But now, let’s say even if a company wanted to try something like Vue, or Svelte or Stencil, etc., ReactJS will have more talent pool. People learn ReactJS because they think it’s popular amongst corporations and corporations use ReactJS due to the very practical fact that it’s easy to find a ReactJS hire.
ReactJS is very stable
React was first released in 2013, and it seems like it will be around for a while. There aren’t many dramatic modifications, and each update has a smooth update course. Even if the team has changed many things in the internals, the user experience remains very similar. They keep breaking changes to minimal and are relatively easier to adapt to.
No Layout Thrashing due to Virtual DOM
Layout thrashing occurs where a web browser must reflow or repaint a web page several times until it is considered ‘loaded.’ It could take a major hit on performance. Again, Virtual Dom and React isn’t the only solution to this but it seems that it’s the solution people seem to prefer so far.
Declarative programming paradigm could also explain ReactJS’s popularity
Declarative programming is like explaining a scene, while imperative programming is like giving instructions on how to create it. Declarative programming improves the readability and reasonability of code. SQL, CSS, etc are declarative. You don’t tell SQL how to fetch the data, you just declare that you want some data.
Functional programming concepts
React extensively borrows ideas from functional programming and isn’t reluctant to use closure in React hooks. Most other frameworks avoid using closures because they might fear that people (junior developers) might find it hard. Hence, developers feel that ReactJS is also helping them become better JS developers in general. ReactJS makes use of things people consider the best of JavaScript.
Conclusion
There may be simpler alternatives (Svelte, for example), but it’s difficult to match ReactJS’ popularity. The talent pool has grown as a result of the perceived coolness of React. Now it’s big and it’ll take a while to take it down. It’s easier to work with React because it’s older, more mature and you can easily find tooling that makes working with it even easier. Newer frameworks tend not to have that luxury. Hence, ReactJs is here to stay.