Learning React Hooks and understanding how it is an improvement over class-style components
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