ANGULAR vs REACT: a comparative analysis that doesn’t choose a side

Reactjs and Angular are both great. Why the choice between the two most used front-end web technologies is a question of suitability not superiority.

Spoiler alert – we’re not going to pick a “winner” in our comparative analysis of Reactjs vs Angular. There’s a reason why the JavaScript library of Reactjs and Angular framework have been the two most used front-end frameworks in web development for some years now. Both are great web technologies from both a technical and business strategy perspective.

There are other JavaScript libraries and frameworks that have their strengths, Vue.js being just one example. But there are far more React and Angular developers on the market than there are experts in any other JS alternative. That, and the fact both are supported by major corporations and have active communities future-proofing applications built in both, is a strong commercial argument as to why organisations opt for either Angular or React for their new applications. Or when migrating legacy applications.

At K&C we have React developers who will insist the library is always the best choice for a dynamic web application. But we also have Angular developers who will always make the case for Angular.

But setting personal preference and experience aside, they each have their technical pros and cons, which are constantly evolving as a result of active support and open source communities contributing to regular update releases. In combination with business and strategic considerations, it is more a case of which of React or Angular is best suited to a particular project in a specific context. As very general rules it is often said:

  • The Reactjs library is best suited to web applications where precise control over styling and functionalities is a priority.
  • The more opinionated Angular framework is best suited to web applications that prioritise consistency of design and layout and minimising room for error eg. Enterprise Applications

Consider this comparative analysis of Angular vs Reactjs as not an attempt to establish the superiority of one over the other. But rather an exploration of the strengths and limitations of each you can consider within the context of your organisation and development projects.

A brief history of Angular and React – Big Tech’s JavaScript champions

Before taking a deeper dive into the technical qualities, business and use cases of Angular vs React, there is some valuable context in the history of the two technologies. It is their sources of origin and continued support from these sources that go a long way towards explaining why Angular and React dominate front-end development in 2022, as well as defining the kinds of apps they are each best suited to.

Angular History and Overview

First released in 2010, having been developed by Google, Angular is the oldest, and arguably most mature, of the JavaScript frameworks and libraries that have shaped front-end development in the decade and counting since. Angular is an open source resource, with its active community driving its continued development, though it also still enjoys support from Google.

TypeScript-based Angular has gone through numerous iterations and one major evolution between Angular 2 and Angular 3 (as of early 2022 the most recent release of the framework is Angular v13).

A fully-fledged ‘framework’, the Angular toolkit contains pretty much everything a developer needs to build apps. As a framework, Angular is especially suited to larger and enterprise applications. It provides a structure which makes it harder for problems to arise between components and sections of code. A more complex app architecture, or pure scale, introduces greater potential for something to go wrong. But it’s also still perfectly possible, and common, for Angular to be chosen for the development of smaller projects.

Microsoft Home Office is one of the most well-know enterprise applications built using Angular.

React History and Overview

Reactjs, or just React as the library is often referred to, was originally developed by another member of the ‘Big Tech’ cluster of companies – Facebook. Facebook released React as an open source JS library in 2013. Supported by both Facebook and a large, highly-engaged OS community, React has since gone from strength to strength to become the most popular JavaScript development technology of recent years.

The most recent React releases, v17 through to v17.0.2, have focused on improving backwards compatibility, making it safer and easier to embed a tree managed by one version of React inside a tree managed by a different version of React. Backwards compatibility between versions of React has been prioritised over new features with a view to further future-proofing the library and should make it an even more attractive choice for organisations from a business case stand point going forward.

As well as the Facebook stable of apps including Facebook itself plus Instagram and WhatsApp, Netflix is another big name that has opted for the more flexible library over the Angular framework. The New York Times, Khan Academy and Dropbox are other big name users doing all or significant parts of their front-end development in Reactjs.

Apps that have dynamic webpages at their core, data visualisation or dashboards or prioritise UX speed or optimal developer control are a sweet spot for React and its Virtual Dom.

Angular vs React – technical differences that influence project suitability

One of the key points you should keep in mind while reading this comparative analysis of Angular vs React is that while the former is a fully-fledged MVC framework, React is a JavaScript library. This means that Angular initially offers more ‘ready’ functionality than React. But it is also less flexible and confines development within the parameters of the framework. Being a framework can mean using Angular is more efficient. But if greater flexibility is needed, React comes into its own.

Here’s what Angular provides directly out-of-the-box:

  • Templates, based on an extended version of HTML
  • XSS protection
  • Dependency injection
  • Ajax requests by @angular/HTTP
  • Routing, provided by @angular/router
  • Component CSS encapsulation
  • Utilities for unit-testing components
  • @angular/forms for building forms

The flipside to all of the out-of-the-box functionality Angular provides is that it can also introduce restrictions. One of React’s major strengths is that it offers more freedom and room to experiment.

React provides the following “out of the box”:

  • Instead of classic templates, it has JSX, an XML-like language built on top.
  • JavaScript
  • XSS protection
  • No dependency injection
  • Fetch for Ajax requests
  • Utilities for unit-testing components

Regular DOM (Angular) or Virtual DOM (React) – What’s The Difference?

React is well-know for its Virtual Dom, despite the fact Dan Abramov and React are not fans of the term:

“I wish we could retire the term “virtual DOM”. It made sense in 2013 because otherwise people assumed React creates DOM nodes on every render. But people rarely assume this today. “Virtual DOM” sounds like a workaround for some DOM issue. But that’s not what React is”.

“React is “value UI”. Its core principle is that UI is a value, just like a string or an array. You can keep it in a variable, pass it around, use JavaScript control flow with it, and so on. That expressiveness is the point — not some diffing to avoid applying changes to the DOM”.

“For example, if it was fast enough to always assign properties on every node update, we would just do that. We wouldn’t throw away our React apps because “DOM is fast now”. That’s nonsense. UI is a value. Function is the building block. Lazy calls (elements) are the glue”.

“It doesn’t even always represent the DOM, for example <Message recipientId={10} /> is not DOM. Conceptually it represents lazy function calls.”

Message.bind(null, { recipientId: 10 })

Dan Abramov – Co-Author of Redux and Create React App

A unique advantage of React is its virtual DOM. It’s what makes it so incredibly fast. In contrast, Angular implements a regular DOM, which affects its performance when it comes to load speed. On the basis of speed-based user experience (UX), Angular loses out here.

How does React’s virtual DOM help speed up changes to a web page for the user? Its virtual state means a single piece of data in an HTML document can be updated and rendered to the user. For example, in the context of Facebook, a piece of user profile data, such as a birthday date, can be changed and only that small element is updated within the virtual document. In the case of a real Dom, like Angular uses, the whole tree structure of the HTML tables needs to be updated up to the point the data point actually changed.

This clearly takes longer, especially if the updated data point is further down the tree structure, meaning updates take more time to render to the user. If an app is going to be subject to a high volume of data requests, Reactjs’s Virtual DOM approach can help make the decision for a development team.

The illustration below, created by Maggie Appleton, offers a great explanation to React’s Virtual Dom, or “Value UI” and why it is so fast:

How React’s Virtual Dom works and supports the speed that is one of the library’s core strengths

An illustrated guide to why React's virtual Dom is so fast 1

An illustrated guide to why React's virtual Dom is so fast 2

An illustrated guide to why React's virtual Dom is so fast 3

An illustrated guide to why React's virtual Dom is so fast 4

Templates — JSX (Angular) vs HTML (React)

React opted to merge UI templates and incorporate JavaScript logic, which no company has ever attempted before. The result is “JSX”. Although it may have sounded like a risky idea, Facebook’s gamble in backing React paid off big-time.

Angular uses templates that enhance HTML with Angular directives (“ng-if” or “ng-for”). React only requires knowledge of JavaScript but to work with Angular you must learn its specific syntax.

State Management

States are an unavoidable reality for any application. To deal with app states, React developers often resort to Redux. However, in Angular, you may not need Redux unless your application is a big one. Some developers prefer to use MobX as an alternative to Redux. To understand which option suits you better, we encourage you to do some more research on both of them and experiment a little.

Data Binding

One major distinction between React and Angular is their different approaches to data binding. Angular uses two-way binding, which you can see when changing the UI element. Here, the corresponding model state changes as well, and vice versa.

React only has one-way binding. First, the model state needs to be updated, which then renders the change in the UI element. That said, if you change the UI element the model state does not change. The developer must figure that out for themselves.

Angular’s two-way data binding method is initially easier. However, for larger applications, React’s approach provides for a better data overview. Both concepts have their advantages and disadvantages. You need to understand the concepts and determine if this influences your decision regarding a framework.

TypeScript or JavaScript/Flow

React uses JavaScript, a dynamically-typed language which most developers are familiar with. This can be regarded as an advantage. To work with Angular, just JavaScript is not enough.

Angular is all about TypeScript, a statically typed language. A simple transpiler compiles TypeScript to JavaScript code, which also means you can write ES5 code in a TypeScript file. An advantage of TypeScript is that it offers more consistency but working with this language will present complications unless you have a JavaScript background.

Is either Angular or React better for mobile applications?

Both Angular and React can be used in mobile app development.

Angular is usually used in combination with Ionic and Capacitora framework and runtime for hybrid mobile applications. Ionic and Angular can also build on top of  Cordova containers and its robust UI component library. However, the resulting app is simply a web app inside a native web-view container. As a result, Ionic-based Angular apps can lag.

React Native, conversely, is a platform developed by Facebook for creating truly native mobile applications using React. The syntax is slightly different, but there are many more similarities than differences between React and React Native. Unlike Ionic, React Native produces a truly native UI for the app. It also allows you to create your own components and bind them to native code written in Objective-C, Java, or Swift.

While the learning curve from React to React Native isn’t steep, it’s also possible to build mobile apps in pure React on top of an Ionic and Capacitor in the same way as Angular WebView apps are created.

Testing Angular and React apps

While writing React code, you will most likely use Jest from Facebook to test what you have written. Jest is incorporated into almost every React project and requires some additional configuration by the developer. It also includes a first-rate mocking library.

Implementing the Angular framework, you’ll deal with Jasmine. Eric Elliott says that Jasmine “results in millions of ways to write tests and assertions, needing to carefully read each one to understand what it’s doing”. Some developers consider Jasmine’s output to be overcomplicated and hard to read.

Learning curve – is it easier to learn React or Angular?

A significant consideration when choosing a new technology to work with is to examine its learning curve and assess how it fits into your previous experience.

For React, you will need to know:

  • JSX
  • how to write components
  • how to manage the internal state
  • how to use props for configuration
  • a routing library (since React doesn’t come with one)
  • state management with Redux or MobX

In Angular, you will need to know:

  • directives
  • modules
  • decorators
  • components
  • services
  • dependency injection
  • pipes
  • templates
  • change detection
  • zones
  • AoT compilation
  • Rx.js

The entry barrier for Angular is objectively higher than for React. The number of new concepts it introduces can be frustrating for newbies. However, that doesn’t mean that React is “easy to learn and use”. We advise you to try both React and Angular to see which is better for you. The label “easy to learn, hard to master”, could be applied to both in relatively equal measure.

Is Angular or React more popular in 2022?

When it comes to assessing the Angular vs React popularity contest, we can look at it in a number of different ways:

  1. Which is more popular among the development community?
  2. Which is most commonly used in new applications and the migration of legacy applications?

Every year, the State of JavaScript report canvasses thousands of JS developers around the world for their opinion and usage of JavaScript technologies, from front-end frameworks to back-end frameworks, data layers and tools. It’s possible to contest how perfectly representative of the whole JS development community the report is, but with over 21,000 international respondents, it’s fair to say it offers some valuable insights in answer to our two questions on the relative popularity of Angular vs React.

Is Either Angular or React A Clear Favourite With Developers?

The report canvasses the popularity of the most prominent main JavaScript frameworks and libraries among developers by looking at:

  • Awareness – is a developer familiar with the framework or library?
  • Interest – is the developer interested in learning the framework or library if they haven’t already done so?
  • Satisfaction – is a developer which has used a given framework or library satisfied with it?

Here are the results from the 2019 survey, currently the most recently published edition:

Developer usage of the most popular JavaScript frameworks and libraries

StateofJavaScript 2020 chart showing popularity of JavaScript frameworks and libraries

In terms of which frontend JavaScript framework or library is most actively used by developers in 2020 (at the time of writing the State of JavaScript 2021 report has been delayed into 2022) React is the clear winner. 80% of survey respondents had used had used React in 2020 compared to 56% who had used second placed Angular. You can also read our blog post comparing the pros and cons of all six of the most prominent JavaScript frameworks and libraries, covering React, Angular, Vue.js, Ember and newcomers Svelte and Preact.

Ultimately, project sponsors decide which front-end technology to use, not the developers who work on the project. They’ll take the technical requirements of the project in relation to the strengths and weaknesses of the JS framework and library options into consideration.  But developer opinion, and what technology they want to work with, will in most cases be an important factor in that decision. Especially as developer enthusiasm is critical to how many potential employees are available on the market, which is a key business case factor.

Developer interest in learning a new JavaScript framework or library

State of JavaScript 2020 infographic showing developer interest in learning front end JS frameworks

In terms of developer interest to learn a popular JS framework or library, React fell to 3rd place in 2019 and 2020, compared to 2nd in 2018 and 1st in 2017. Developers were most enthusiastic to pick up Svelte, followed by Vue.js. Angular dropped into 8th which would seem to indicate a deficit of frontend developers who don’t already know Angular being interested to learn the framework.

It should be taken into consideration that React and Angular are the most known  front-end JS technologies in 2020, as they were in 2019, which clearly impacts the ‘interest to learn’ figures. Most respondents will already know at least one of either React or Angular. But still a valuable insight.

State of JavaScript 2020 infographic chart showing developer awareness of front end javascript frameworks

The final metric we can look at for insight into whether React or Angular is the more popular JS development resource is how aware developers are of the most popular frameworks and libraries. Unsurprisingly, 100% of respondents were aware of both React and Angular, so nothing to seperate the two here.

However, based on all three developer popularity and usage metrics, we can safely say that React is currently more popular than Angular. That, of course, doesn’t mean there are not many scenarios in which Angular may be the better choice for a particular app.

Angular and React use cases – which big name companies use React and which Angular?

HUGE companies are utilizing both React and Angular. We’re talking about some of the biggest in the world. Here is just a small sample:

Famous users of Angular and React

Angular vs React conclusion – “it depends”

Articles that assess the relative merits of React and Angular will probably always most often take the approach of setting the two front-end JavaScript technologies up against each other in a winner-takes-all competition that ranks them in first or second place. But that really isn’t the way these two front-end alternatives should be looked at.

At the end of the day they are both fantastic JavaScript resources and have a level of traction that means most front-end developers have experience in at least one or the other, if not both. As already mentioned, an abundance of Angular and React developers, compared to those with experience in alternative frameworks and libraries, is a big part of the commercial draw. As is active support and communities future-proofing both.

Angular vs React is the JavaScript, and even front-end web development equivalent of Apple vs. Android or Adidas vs. Nike. The reality is that there is no “best” JS framework or library. React may be the better technical fit for one app and Angular for another. And many apps might be created to an equal or comparable standard in either one or the other. The choice between Angular and React just as often comes down to business considerations like what technology has been used in other apps owned and maintained by the same organisation.

There are still developers that only want to work with Ember and that’s great if it works for you and the apps you are building. We choose our library, framework and the rest of an application’s tech stack based on a range of conditions at a specific point in time and within a particular context.

Sometimes it’s Angular, other times React. And we also use other frameworks such as Vue. Some of our team, given a choice, would often choose Vue ahead of either React or Angular. Others switch between the three depending on use case without giving it a second thought.

K&C – Nearshored Angular and React developers, Munich HQ

K&C are a Munich-based web development agency and IT services company with over 20 years of history. Our front end experts boast a wealth of experience building applications for our partners.

K&C’s Angular and React developers have helped realise applications that range from enterprise-level portals for some of Europe’s best known brands to single page applications and mobile applications for hugely promising start-ups.

With experience across all major contemporary front and back end web development technologies, we’d love to help you decide the optimal tech stack for your next development project. There’s rarely a definitively objective ‘best choice’ between Angular, React and the other framework options. But by relying on a combination of our senior developers’ experience and your business’s priorities we can always reach a strong consensus together.

Tech expertise should be a given for a web development agency with K&C’s history. We know that the missing ingredient you are looking for in a partner is communication, reliability and consistency. That’s what we strive to offer all of our partners.

We’d love to hear about your Angular or React project. So please do get in touch!

Featured blog posts