Skip to content

v4.4.0

Compare
Choose a tag to compare
@dai-shi dai-shi released this 01 Aug 02:08
· 106 commits to main since this release

This adds new zustand/traditional entry point and deprecates equalityFn from zustand.

Migration Guide

If you don't use custom equalityFn, nothing is required.

For those who use custom equalityFn such as shallow:

// previously
import { create } from 'zustand'
const useFooStore = create((set) => ...)

// now
import { createWithEqualityFn } from 'zustand/traditional'
const useFooStore = createWithEqualityFn((set) => ..., Object.is)
// Object.is is the default quailtyFn in zustand create; to match that behavior, pass that function here. This can be updated to shallow or anything else

What's Changed

  • feat: deprecate equalityFn and add createWithEqualityFn by @dai-shi in #1945
  • fix: declare @types/react as peerDep to avoid phantom dep by @leviosa-e in #1963

New Contributors

Full Changelog: v4.3.9...v4.4.0