React Memo | useMemo | useCallback - Optimize Performance of your React Applications
Video Statistics and Information
Channel: Justin Kim
Views: 17,609
Rating: 4.9754348 out of 5
Keywords: Javascript, React, Programming, ES6, ECMAScript, Coding, Tutorial, Code Alongs, 2020, Hooks, useState, memo, memoization, render, Lifecycle Methods, React.memo, state, props, useCallback, useMemo
Id: 3cYtqrNUiVw
Channel Id: undefined
Length: 25min 53sec (1553 seconds)
Published: Sun Feb 09 2020
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Well done video overall, but there's an important bit of information that would lead to premature optimization.
Take a look at the Virtual Dom, basically even though the Child component is "re-rendering", it's only re-renders internally in react-fiber, no DOM update is actually done.
You can see this in practice by enabling Paint Flashing in chrome dev tools. Even though "Child is Rerendering" will show in the console, that div doesn't get repainted.
If you were to pass the counter as a prop and used in the child component it does repaint with the updated value!
That's the point of the React Fiber magic.