TypeError: dispatcher.useSyncExternalStore is not a function
See original GitHub issueTypeError: dispatcher.useSyncExternalStore is not a function
19 | const categorySlug = query.categorySlug
20 |
> 21 | const addToCart = useCart((state) => state.addToCar
```t)
i am having this error when using zustand in component, how to fix this ? i am on nextjs, with react 18.1 package, being looking into website for this problem, but there is so less infomation about it.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Uncaught TypeError: dispatcher.useSyncExternalStore is not ...
This happens because react-redux is not supported yet with React 18 (React and React Native). Downgrade react-redux to the previous version ...
Read more >TypeError: dispatcher.useSyncExternalStore is not a function ...
Describe the bug I hit this error: TypeError: dispatcher.useSyncExternalStore is not a function. (In 'dispatcher.
Read more >TypeError: dispatcher.useSyncExternalStore is not a function
Hi all, I think I'm going crazy, because I've been trying to debug this issue with the apollo client for ~an hour, and...
Read more >React, how to fix the TypeError: resolver is not a function error
Turned out the solution was very simple. I was doing some editing and I commented out the default export to component of the...
Read more >Nextjs and React PDF Tutorial: WATCH THIS BEFORE ...
useSyncExternalStore is not a function PDFDownloadLink TypeError : ... work only work when render but hit error when reload page dispatcher.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
thanks for the update @tuoxiansp
the root of the issue from my side is how react-babylon-js handles its internal component state (because it is not a purely react component, it is coupled with babylonjs).
my fix was simply to list the state higher up to the Babylon component, and passing the changes as props inside that component, it solved it for me.
example:
instead of :
it became :
hope it helps
Same issue for me with react-pixi-fiber but above doesn’t fixed the issue for me