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.

useMemo real-world example

useMemo real-world example

Welcome back. To understand the use memo working with real-world example, I have put up a component here. That is the product list component. I'm going to walk through this component step-by-step and in detail for you. And then we are going to understand and debug using the react dev tools that how use memo is actually helping us. By doing a real world scenario example, you are going to be more confident that when you want to use the use memo and when you should not be using it. So without wasting further time, let's start. So this component productlist.tsx is going to be found inside your hooks project in the components folder. As you can see, I have already listed down this component here in the app.tsx and that's how our component actually looks like. We have a search box where we can search based on the name of the product and we can also search products based on the category. After that we have an count button which can increment the value and I'm going to explain the functioning…

Contents