Dilemmas with React Hooks: Persistence and Memoization
In this part, we will discuss persistence and memoization with React hooks. Memoization is persistence with a twist: we calculate a function, and we want to remember its result so we will be able to avoid repeating the calculation of the same function for the same inputs. We can omit the second parameter, and then the memoization will occur only if the current values of all the props are shallow equal to their values on the previous render.
Source: yearn2learn.netlify.com