Skip to content
masterclass Buddy

Zustand · Concept

equality function

createWithEqualityFn makes a React store hook like create, but lets you set a default equality check. The check can prevent re-renders when selected data has not meaningfully changed.

Last updated

Syntax

const useSomeStore = createWithEqualityFn(stateCreatorFn, defaultEqualityFn)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • create
  • createStore
  • shallow
  • useStore
  • useStoreWithEqualityFn
  • useShallow

Source: createWithEqualityFn - Zustand Docs. Checked 2026-11-03.