A Look at the React useMemo Hook

1 · · Dec. 6, 2019, midnight
You may have seen, released along with React Hooks, a strange hook called useMemo. What could this strange, 👽alien👽 hook mean and what is it used for? Most importantly, how can it help you and why do you need to know about it? First, a little brush up on JavaScript equality. Referential Equality You may remember how Javascript compares objects 🥴. There are some tricky results when we run equality comparisons: {} === {} // false const z = {} z === z // true React uses Object.is to compare compo...