React a technical elaboration
What is React
As you can see on google trends, React is dominating the space of libraries and frameworks for building user interfaces. The other two players here are a
Angular (in yellow) and VUE JS (in blue). So if you want to expand your job opportunities as a front-end developer, you should have React on your resume.
At the heart of all React applications are ‘components’. A component is essentially a small piece of the user interface. So, when building applications with react, we build a bunch of independent, isolated, and reusable components and then compose them to build complex user interfaces.
Every react application has at least one component which we refer to as the root component. This component represents the internal application and contains other child components, so every react application is essentially a tree of components. If you have worked with Angular 2 it should sound familiar. We can reuse components on other pages or even in different applications, so each component is a piece of UI. We can build these components in isolation and then put them together to build complex UIs.
A 'class' & DOM element
Unlike the browser or the real DOM, this virtual DOM is cheap to create. When we change the state of a component, we get a new react element. React will then compare this element and his ‘children’ with the previous one, it figures out what has changed and then it will update a part of the real Dom to keep it in sync with the virtual DOM.
Simply change the status
That's exactly why this library is called React because when the state changes, React essentially reacts to the state change and updates the DOM.
You can choose other libraries, but as previously explained, it just works better and faster. This is what we think, the future of frontend or UI & UX development