fullstackpilot Logo
JavaScriptReactreactjs

Why choose React in 2022

Martin Milo
By on

Why choose React in 2022? New libraries and frameworks pop up every year, yet React remains one of the most popular Javascript library for Front End development. In this blog post, I will explain why React is a great library to choose in 2022.

Table of Contents or 5 Reasons to Choose React in 2022

1. Popularity

While trends in tech and especially Front End are pretty short-lived, there's no doubt that React proved to stay one of the most popular library for building user interfaces over the last few years. But what does popularity mean?

One may look at the amount of GitHub stars, which is a good indicator of how much the specific library is liked by other developers. React is currently at 180k stars. Vue may have 10k more stars right now as of January 2022 but if we look at the Downloads in the past 5 years from npmtrends, React completely dominates this metric, having around 4-5 times the amount of downloads as Vue.

The number of downloads and stars is one thing. Still, perhaps the most significant indicator of the popularity is the fact that there is an enormous shortage of good React developers. Netflix, Dropbox, New York Times, Khan Academy, Instagram, Reddit, Paypal, and many more are built with React.

If we dive into the mobile world, including React Native, we will find a vast pool of mobile apps being built by this library.

2. Easy to learn

Learning speed is always relative, but React is generally easy to learn compared to the other libraries. This is especially true if you compare React with Vue or Angular, which are both quite popular nowadays - the big three of Front End development.

React is just a library with a specific focus, whereas Vue is "The Progressive JavaScript Framework" (taken from official https://vuejs.org), and Angular is a full-fledged framework.

React is relatively easier to learn from the big three because of its simplicity. React is declarative, component-based, and focused solely on building user interfaces. It does not dictate to you what libraries you have to use with it.

To be fair, the learning speed comparison between React and frameworks doesn't really make that much sense. For a good single page application (SPA), you'd need to include more libraries to handle routing, state management, managing async data, styling, and more.

This, of course, has advantages if you already know some of these libraries, and it also gives you the power to combine the stack that serves your needs. On the other hand, it means that your app is composed of React and many 3rd party libraries that follow different guidelines, best practices, and their documentation differ a lot.

I still think React wins in this competition. It is much more straightforward than the other options. Being declarative and using only one-way data binding is making its learning curve steeper, and that's a win for anyone trying to learn this technology.

3. Flexibility

React is very flexible, and it can be used with different libraries. You don't have to use Redux, React Router, or any popular libraries, although you might want to. You can use any state management library or native concepts such as React Context to handle the global state. This is really great for people who know what they're doing and want to choose their own way to build things.

You can get comfortable with React and add more libraries and concepts as you go. The flexibility is great for learning purposes as well. We can say that React is not opinionated as it is up to you to choose how to deal with other parts of the app.

At the end of the day, you should always pick the right tool for the job. Having this amount of freedom means that you can choose whatever suits you to complement React and then change it as you scale or find a library that handles things more intuitively. I've built React apps with all kinds of setups, be it with and without Redux, without 3rd party state management library, different testing libraries, and various styling options. I can only say that the flexibility is just great.

4. Learn once, write anywhere

On top of not making any assumptions about the rest of your stack, React works far beyond websites and web apps. It can be rendered on the server using NodeJS and even on the mobile apps as React Native. Learning React thus opens up a door to a much broader world than just building user interfaces in the web context.

5. Community support

React enjoys a massive and active community. We can't forget that React was created by Facebook, yet the reason for the enormous community is again its popularity. Many articles, blog posts, Stack Overflow questions, and other resources can help you when you're stuck. The community is also very helpful, so you're likely to get help when you need it.

Conclusion

React is great for you not only if you're just trying to get your feet in the programming world but even if you've been building UI's as a professional with whatever library or framework. Its massive popularity, flexibility, and ease of learning make it one of the most sought-after skillsets in today's job market.

The simplicity that comes from building everything using just components can be very freeing once you've been doing web development long enough.

There's no shortage of resources online to learn from, so if you're new to programming or just looking for an easier way to build user interfaces in your job, look into learning React. I can't wait to hear what you think about it! Would you like more information on my projects with React? Let me know in the comments below.

Share: