Learning React fundamentals
React is a declarative library to build interactive and dynamic UIs, including isolated small components. Sometimes, it is also referred to as a framework because it is capable and comparable with other JavaScript frameworks, such as AngularJS. However, React is a library that works with other supported React libraries such as React Router, React Redux, and so on. You normally use it to develop SPAs, but it can also be used to develop full-stack applications.
React is used for building the view layer of the application, as per a Model-View-Controller (MVC) architecture. You can build reusable UI components with their own state. You can either use plain JavaScript with HyperText Markup Language (HTML) or JavaScript Syntax Extension (JSX) for templating. We'll be using JSX in this chapter. It uses a virtual Document Object Model (VDOM) for dynamic changes and interactions.
Let's create a new React app using the create-react-app
utility. It...