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

Learn React with TypeScript
By :

In this chapter, we will build a checklist component and use various patterns to make it highly reusable but still strongly typed.
We will start by using TypeScript generics to strongly type the data passed to the component. Then, we will use the props spreading pattern to make the component API-flexible and allow consumers of the component to custom render parts of the component using the render props pattern. After that, we will learn how to make custom hooks and use them to extract logic for checked items and how to make the state within a component controllable to change the component’s behavior.
By the end of this chapter, you’ll have mastered key TypeScript and React patterns that will strengthen your ability to build flexible, maintainable, and reusable components.
We’ll cover the following topics: