useMemo explained with several easy-to-follow examples. This React Hooks useMemo tutorial will show you why and how to apply the useMemo React hook to improve your React app performance and gain referential equality.
(00:00) Intro
(00:08) Welcome and Overview
(00:33) Identifying the need for useMemo
(02:10) useMemo for performance optimization
(02:59) useMemo for referential equality
(04:00) useMemo vs useCallback Part 1
(04:17) Primitive values in a hook dependency array
(06:12) Eliminate the performance lag with useMemo
(07:48) useMemo vs useCallback Part 2
(09:47) Achieving referential equality for an array with useMemo
🔗 Source Code: https://github.com/gitdagray/usememo_tut
🔗 ES7 React JS Snippets Extension for VS Code:
https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets
🔗 React Dev Tools Extension for Chrome:
https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi
📚 References:
ReactJS Official site: https://reactjs.org/
React Wikipedia: https://en.wikipedia.org/wiki/React_(JavaScript_library)
#reactjs #react #hooks