What Is React and How to Master It?
Written by @mdfd on 2023-01-30T13:21:25.830ZWhat Is React and How to Master It?
In this article, I'll talk about React, a popular JavaScript library, and I'll share a learning roadmap for how to master it.
React specialists are in high demand: Yandex uses it; Netflix, Facebook, as well as many other well-known products have been built using React.
What is React? React is a JavaScript library for creating user interfaces. First up, note that React is a library and not a framework, though it's often referred to as one. This is because it doesn't create any sort of "scaffold" for the project. That means that this library alone is generally not enough to complete a project. Indeed, React developers often create apps using extra tools like Redux, TypeScript, and Jest.
Instead, React just performs one task: it displays interface components synchronized with the application's data.
Soon after the advent of React, similar options like Vue.js and Svelte essentially took over the front-end world. The common denominator here is that they all help solve problems based on a declarative approach rather than an imperative approach. Here's how those two approaches break down:
Declarative approach: describes the end result. Basically, the result we want to have. Imperative approach: describes the specific steps to achieve an end result. That is, the steps we must take to get a result. As it turns out, the declarative approach is great for creating interfaces, and this has taken root in the tech community. Furthermore, this approach doesn't solely apply to web technologies. For instance, Apple has recently introduced the SwiftUI framework based on the same principles.
To better understand the difference between the two approaches, let's take a look at them in more detail. We'll create two versions of a simple application. One with HTML and JS (using an imperative approach) and the other with React (applying the declarative approach).
Our application will display a number and a button which will increase the value of the number by one each time it is clicked.