Real-Life Use-Cases for useCallback and useMemo
O ne of my friends gives his react interview, and tell me, his interviewer asks him to give some real-life use-cases where he actually uses the useCallback and useMemo to solve his problem. And unfortunately, he got stuck at that point. I have also taken lots of interviews and personally observed that developers know the definition of useCallback and useMemo but they actually don’t know when to use them. So they didn’t use it to solve their real-life problems. So in this blog, I will explain when to use them and solve some real-life use-cases in a very simplified way. T a ke a cup of coffee or anything you want 😉 and let’s begin. https://c.tenor.com/ useCallback One of my friends was making arguing with me that we have to wrap the all function in useCallback which we are passing as props in the child component . “Every callback function should be memoized to prevent useless re-rendering of child components that use the callbac...