From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

useState and useContext: Recap and pitfalls

useState and useContext: Recap and pitfalls

Hello and welcome back. In this video, we are going to recap what we learned and what we know so far about the state management. So far, we know that we have to use the useState hook when we are dealing with a small application with a few number of components and we can use the useState for local state management of a component. And if we have a medium size of application, we need to use the use context or the context API for shared state management. If multiple components are looking for a one single state and they need to update those values as well and read it from it as well, then we are going to need the use context hook. We should be avoiding props drilling at all cost, otherwise it can make your application perform very slowly and you can introduce new problems to your application. All this information holds true for small to medium size of applications. Since we are learning about advanced rate management, we will get to know that when The large-scale application comes into…

Contents