React.memo in React explained by Frontend Master #reactjs #javascript #frontendmaster #webdev

preview_player
Показать описание
Learn About HOC Here:

Chapter Markers:

00:00 Intro
01:01 Problem
05:50 When to use memo

#udemy #leetcode #geektrust #geeksforgeek #hackerrank #codechef #iit #uptu #aktu
Рекомендации по теме
Комментарии
Автор

One thing I want to add, for object, arrays and functions, memo does the shallow comparison. If objects are 1 level nested are we are passing same reference, then memo will work.
In my video I am passing new reference everytime, hence the check is failing.

Below is code that will work with memo, because we are passing same reference of object and it has only one level.

function App() {
const [obj, setObj] = useState({});
const [count, setCount] = useState(8);

function handleIncrease() {
setCount(counkt + 1);
}

return (
<div className="App">
<h1>React.memo()</h1>

<button is {count} </button>

<MemoizedChild p={obj} />
</div>
);
}

rahuulmiishra
Автор

Your all video is very informative like this video... now i understand full proof useMemo

please make a video on token based auth.

sumitsingh
join shbcf.ru