React vs. AngularPosted by Itay Herskovits on Feb 17, 2015
A Quick React Primer
A Lack of Opinion
AngularJS can be referred to as an “opinionated” framework. This means that the developers of AngularJS had an idea of what a “good” architecture for an application’s front-end should look like, and they built that architecture into AngularJS at its very core. When your application can fit within those confines, then AngularJS can be a joy to work with. However, if you find yourself deviating from AngularJS’s desired architecture, you can encounter a lot of pain. ReactJS, in comparison, does not attempt to impose an architectural ideal on your code base. It allows you to do lazy loading of components, decreasing load times and allowing you to more closely manage how your data is represented.
One benefit of Angular’s use of directives for data-driven display is that display templates are incredibly simple to write. Developing a UI for your data in AngularJS is extremely straightforward, and while you may give up some control over specific portions of the data representation the end result is a much more intuitive approach to user interface that takes less code and seems more “obvious.” React, on the other hand, tends to require custom functions to drive data display. This often means that you need to define how your data will be represented before it is coded into the DOM, which can cause a disconnect when trying to determine exactly how a particular element will be rendered.
One more difference between AngularJS and React is the architecture each framework represents. AngularJS began life with a close representation of a MVC (Model-View-Controller) pattern, but has since evolved into a MVVM (Model View ViewModel) -MVC hybrid architecture. React, on the other hand, is focused on the “V” in MVC – it is designed to work with data representation, and leaves other elements of the application architecture to other components as selected by the programmer. An interesting note is that due to these architectural choices, it is entirely possible to augment an AngularJS application with React in order to enhance performance of troublesome components.
Get a free hosted AngularJS backend with features such as user management, social signin, payment integration, security and more – GET STARTED NOW.