Demo using the useMemo hook in React that shows how an expensive calculation (in this case a filtering) is memoized and not executed each time the component renders. It is executed only when the values used by the calculation are changed.
See the Tutorial for more details.