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

Learn React with TypeScript
By :

React Hooks are special functions that let you use React features, such as state, inside components. In this chapter, we will learn about React’s common Hooks and how to use them with TypeScript. We will implement the knowledge of all these Hooks in a React component that allows a user to adjust a score for a person. We will start by exploring the effect Hook and begin to understand use cases where it is useful. We will then delve into two state Hooks, useState
and useReducer
, understanding when it is best to use each one. After that, we will cover the ref Hook and how it differs from the state Hooks, and then the memo and callback Hooks, looking at how they can help performance. In the last section, we will touch briefly on other React Hooks that are either less common or covered in depth later in this book.
By the end of this chapter, you’ll have a working knowledge of the common React hooks.
So, we’ll cover the following topics:
...