Skip to content

fix: expose useSyncExternalStoreWithSelector on the default export - #32

Open
letstri wants to merge 1 commit into
TanStack:mainfrom
letstri:fix/sync-external-store-default
Open

fix: expose useSyncExternalStoreWithSelector on the default export#32
letstri wants to merge 1 commit into
TanStack:mainfrom
letstri:fix/sync-external-store-default

Conversation

@letstri

@letstri letstri commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

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.

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

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 4ab8119 and e074bca.

📒 Files selected for processing (3)
  • .changeset/sync-external-store-default.md
  • packages/redact/src/react/index.ts
  • tests/default-export-shim.test.tsx

Thanks 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

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant