Bloom Interactive

Bloom Interactive

← Back to home
Preview of useDeepMemoView on GitHub ↗

useDeepMemo


A React hook that memoizes by deep equality — returns the previous reference when content is unchanged, even if the input is a new object.

  • useMemo compares deps by reference, so a new object with identical data still invalidates
  • useDeepMemo uses lodash.isequal to compare by value, keeping the old reference stable
  • Prevents unnecessary downstream re-renders in memo-wrapped children
  • Avoid passing values that contain functions — isEqual returns false for different instances, causing an infinite loop