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

Learn React with TypeScript
By :

In this section, we’ll cover some of the different types of state and how it can be managed. React state increases code complexity, so it’s helpful to be able to categorize it and potentially offload its management.
Server state is data fetched from an external server/API to render in the UI. It’s also referred to as remote state or data state.
We learned in Chapter 7, Server Component Data Fetching and Server Function Mutations, how RSCs remove the need for server state because data is fetched and rendered all on the server.
Sometimes we do need to fetch data in Client Components, and in Chapter 8, Client Component Data Fetching and Mutations with TanStack Query, we learned how TanStack Query manages server state for us and how managing this ourselves using useEffect
and useState
is problematic.
Form state includes field values, validation error messages, and whether submission indicators...