-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Using ThemeSwitcher alone fails with "Cannot read properties of null (reading 'useSyncExternalStore')" #4635
Comments
The theme switcher works for each demo in the docs for me; can you provide a reproduction CodeSandbox or StackBlitz link for us to be able to check this? |
have the same problem using DashboardLayout
|
Hmm. I've set the same dependency versions as in the docs example and now it works. Also I missed "@vitejs/plugin-react" dependency. Maybe it caused the problem. idk |
To reproduce the issue, you can use the code in the sandbox from the doc, and update the dependencies of react to version 18.3.1, according the below code I listed Toolpad dependencies and it seems that it requires react 19. Is this on purpose? ├─┬ @toolpad/[email protected] The package.json updating the docs sample to reproduce the issue: Thanks |
Steps to reproduce
Steps:
TypeError: Cannot read properties of null (reading 'useSyncExternalStore') at exports.useSyncExternalStore (/myfolder/node_modules/@toolpad/utils/node_modules/react/cjs/react.production.js:529:33) at useSsr (/myfolder/node_modules/@toolpad/utils/dist/hooks/useSsr.cjs:48:16) at ThemeSwitcher (/myfolder/node_modules/@toolpad/core/node/DashboardLayout/ThemeSwitcher.js:32:37) at Wc (/myfolder/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:68:44) at Zc (/myfolder/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:70:253) at Z (/myfolder/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:89) at $c (/myfolder/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:78:98) at bd (/myfolder/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:77:404) at Z (/myfolder/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:76:217) at Zc (/myfolder/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js:71:479)
Current behavior
No response
Expected behavior
No response
Context
No response
Your environment
Search keywords: ThemeSwitcher
The text was updated successfully, but these errors were encountered: