-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Full-Stack React, TypeScript, and Node
By :

In this section, we'll review what class-style components are. We'll see why inheritance-style code reuse and lifecycle methods, although well intentioned, ultimately did not provide good code reuse and component structure capabilities. Although we will not write our code with class components, it is very important to understand class-based components because most existing React code uses classes, since Hooks are still somewhat new. So, as a professional developer, you will have to read and maintain this code base until it uses Hooks.
In order to understand the limitations of class-style components, we first need to review what they are. A React application is made up of many individual structures called components. When using a class-based style, these components are JavaScript ES6 classes that inherit from React.Component
. A component is basically a machine that may contain data, called state...