This code base offers as an example to learn more about React's memoization tools & APIs and was written to accompany this article.
- Clone the repo
- Run
yarn
to install the dependencies - Run
yarn start
to start the development server. - Install the React Devtools browser plugin in your main browser.
- Enable "Highlight updates on re-renders". See: this document for instructions.
- Edit a catch phrase on a brokerage card with memoization disabled, notice how slow it is!
- Edit a catch phrase on a brokerage card with memoization enabled and notice the difference in performance.
- Open your console to see the
Profiler
data. Play around with the code by adding and removinguseCallbacks
,useMemo
andReact.memo
to see how it affects the rendering performance.