The Vite plugin aliases use-sync-external-store/shim/with-selector to this
package, and zustand reads it as a CJS default import:
import useSyncExternalStoreExports from 'use-sync-external-store/shim/with-selector.js'
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports
useSyncExternalStoreWithSelector is only a named export here, so that
destructure gives undefined and anything on zustand's useStoreWithEqualityFn
throws useSyncExternalStoreWithSelector is not a function. React Flow hits it
on first render, in HandleConfigProvider.
Adds it to the default export next to useSyncExternalStore, which is already
there for the plain use-sync-external-store/shim alias.
Covered by tests/default-export-shim.test.tsx.
Warning
Review limit reached#
Next included review available in 1 minute.
Check out review usage here.
View limit details
Limit details: You’ve used all 2 included reviews currently available.
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Learn how review limits work.
Review configuration:
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
02dfa19f-db3a-4468-a31b-6b9aa2b2a0fb📥 Commits
Reviewing files that changed from the base of the PR and between 4ab81196f8af5857028d0ea486f067bb90e2293b and e074bca744a11bf11aee3a2c05c81e80d9cd8a34.
📒 Files selected for processing (3)
.changeset/sync-external-store-default.mdpackages/redact/src/react/index.tstests/default-export-shim.test.tsxThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share