Having been a DevOps Engineer for a while, I wanted to take a sneak peak on what is going on in the front-end world; all I heard about was React.js. So I wanted to dive in and see what is it all about.
This article is not intended for seasoned React Pros but for newbies who are wondering what is it that makes “React.js” so special when there are lot of other js libraries and frameworks to choose from.
Disclaimer: My knowledge on React.js is very limited but this article might be a good start (hopefully) for people who wants to get a basic familiarity with react.js.
But then you may ask why is React so popular?
Well, here are a few reasons.
const element = <h1>It’s crazy right?</h1>;
C. You can do much more when you decouple yourself from DOM and use it as a rendering platform or target. It lets you have a better control over the life cycle of the application. Thanks To React, you can render on the client or server. Instead of updating the DOM node completely, it uses a different approach called Virtual DOM. Using this, react keeps your last DOM version in its memory and when it a new DOM is versioned, it basically does computes the difference of the two DOM versions and updates just the difference rather than doing a full replace. This way you can avoid all those costly DOM operations and happily update your user interfaces without panicking.
D. React did not just prove that DOM can be used as rendering target but also capitalizes on the idea of uni-directional data flow. When you build large applications it gets difficult to start reasoning about the architecture of the applications because you will have hundreds of developers working on the single code base. With complex applications it gets difficult to identify bugs because there are lot of events firing that mutate the data all over the place. By keeping your data in uni-directional there will be only a single source of truth. Application state is contained in specific “stores” so the components of your application remain loosely coupled. This gives you a clear idea on how your components react to state change.
E. React developer tools makes debugging your application much easier. You can easily inspect your component hierarchies.
E.5 It’s backed by “FACEBOOK” developers. With their brand recognition, it is more attractive to the developer community.