useMemo will only recompute the memoized value when one of the deps has changed.
useMemo
deps
16.8.0
https://react.dev/reference/react/useMemo
useMemowill only recompute the memoized value when one of thedepshas changed.