Skip to content

[core] Fix useSyncExternalStoreWithSelector in React 17 #2090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

bernardobelchior
Copy link
Member

@bernardobelchior bernardobelchior commented Jun 10, 2025

Fix useSyncExternalStore import error in React 17. use-sync-external-store/with-selector does not import the shim, so it broke in React 17 which does not support useSyncExternalStore. The fix is to import use-sync-external-store/shim/with-selector.

This use-sync-external-store/with-selector import was added in this commit, so it isn't in any release yet.

Error reproduction

Fix confirmation

More info: mui/mui-x#18303 (comment)

@bernardobelchior bernardobelchior added the bug 🐛 Something isn't working label Jun 10, 2025
Copy link

pkg-pr-new bot commented Jun 10, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@base-ui-components/react@2090

commit: 4b73d64

@mui-bot
Copy link

mui-bot commented Jun 10, 2025

Bundle size report

Total Size Change: 🔺+1.55KB(+0.11%) - Total Gzip Change: 🔺+424B(+0.09%)
Files: 41 total (0 added, 0 removed, 2 changed)

Show details for 41 more bundles

@base-ui-components/reactparsed: 🔺+777B(+0.25%) gzip: 🔺+214B(+0.23%)
@base-ui-components/react/selectparsed: 🔺+777B(+0.66%) gzip: 🔺+210B(+0.53%)
@base-ui-components/react/accordionparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/alert-dialogparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/avatarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/checkboxparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/checkbox-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/collapsibleparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/context-menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/dialogparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/direction-providerparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/fieldsetparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/formparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/inputparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/menubarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/merge-propsparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/meterparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/navigation-menuparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/number-fieldparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/popoverparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/preview-cardparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/progressparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/radioparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/radio-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/scroll-areaparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/separatorparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/sliderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/switchparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/tabsparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toastparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toggleparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toggle-groupparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/toolbarparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/tooltipparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-no-ssrparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/unstable-use-media-queryparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/use-renderparsed: 0B(0.00%) gzip: 0B(0.00%)
@base-ui-components/react/utilsparsed: 0B(0.00%) gzip: 0B(0.00%)
Base UI checkboxparsed: 0B(0.00%) gzip: 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 4b73d64

Copy link

netlify bot commented Jun 10, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 4b73d64
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/68482802aeeb880008660bba
😎 Deploy Preview https://deploy-preview-2090--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bernardobelchior bernardobelchior marked this pull request as ready for review June 10, 2025 12:49
@bernardobelchior bernardobelchior merged commit dc05a31 into mui:master Jun 10, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants