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

Full-Stack React, TypeScript, and Node
By :

In this section, we will learn about React Hooks. We'll take a look at an example project and see how it works. Since this book is primarily about Hooks, at least with regard to React, it will help us write our code later.
Let's discuss some of the reasons for Hooks. We saw in the class components section that classes have lifecycle methods that allow you to handle certain events that occur while a component is alive. With React Hooks, we don't have those lifecycle methods, because with Hooks all components are functional components. We created a functional component in the class-components sample app called GreetingFunctional
in the previous section. A functional component is a component that is a JavaScript function and returns JSX. The reason for this change is that the entire design is attempting to move away from Object Oriented Programming (OOP) inheritance models and...