The Beauty of React.js
React uses JSX
React's Virtual DOM
The way the browser's DOM(the "real" DOM) renders and re-renders webpages can be costly because every time you touch a node just to read an attribute or a class name, or to get to a child or sibling, the browser has to search, check, parse a rather large number of proprieties and values for each node. React's VDOM is kind of like this legacy browser problem. It uses a conceptual DOM known as a virtual DOM that holds a representation of the DOM tree in memory by creating an in-memory data structure cache, perform computations on DOM nodes and finally decides which part of the DOM has been mutated and then updates the DOM efficiently rather than re-rendering the entire DOM tree. By using the virtual DOM, React applications tries to minimise DOM manipulation operations thereby making applications faster and more performant. Some developers think that the Virtual DOM is the best thing that has happened to web development since AJAX.
React's reusable, composable and stateful components
React is Declarative
React gives developers an opportunity to developers to declaratively create user interfaces. What this means is that, you tell react what should be done and let it figure out how to perform it unlike in imperative programming where you have to tell the machine how to perform an action. Declarative style is better as you don’t have to care about the implementation.
As of the time of this writing, React has received over 164K stars on GitHub, has over 1,533 contributors and has been forked about 32.7k times, this just goes to show that the React is backed by the a massive developer community.
These are just some of the pros of building user interfaces with React.js. This doesn't mean it doesnt come with its own bowl of disadvantages(for example it doesn’t perform well with SEO) but I guess I'd just leave that as stories for another time. As always thank you for rendering my article. You can connect with me on twitter @brandonbawe. Keep on exploring and exploiting the beauty of React(it's good for your health😁😁). See you next time. Happy Coding 💻.