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

Learn React with TypeScript
By :

We’ve already used React state many times throughout this book. In this chapter, we’ll cover React state in depth, starting by understanding the different types of state and situations when we can avoid writing code to manage state ourselves.
The chapter then focuses on shared state, which is the trickiest type of state to manage. We’ll explore different approaches to managing shared state, discussing the pros and cons of each approach. To experience the different approaches, we will build a simple app containing a header that displays the user’s name, with the main content also referencing the user’s name. The user’s name will be stored in a state that needs to be accessed by several components.
As such, we’ll cover the following main topics in the chapter: