You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use @preact/signals-react with @shopify/react-native-skia results in the following error:
Uncaught TypeError: dispatcher.useSyncExternalStore is not a function
at useSyncExternalStore (react.development.js:1671:1)
at Object.apply (signals.module.js:1:1)
at renderWithHooks (react-reconciler.development.js:6412:1)
at mountIndeterminateComponent (react-reconciler.development.js:9238:1)
at beginWork (react-reconciler.development.js:10476:1)
at HTMLUnknownElement.callCallback (react-reconciler.development.js:12184:1)
at Object.invokeGuardedCallbackDev (react-reconciler.development.js:12233:1)
at invokeGuardedCallback (react-reconciler.development.js:12292:1)
at beginWork$1 (react-reconciler.development.js:16531:1)
at performUnitOfWork (react-reconciler.development.js:15337:1)
at workLoopSync (react-reconciler.development.js:15268:1)
at renderRootSync (react-reconciler.development.js:15231:1)
at performSyncWorkOnRoot (react-reconciler.development.js:14821:1)
at react-reconciler.development.js:2546:1
at unstable_runWithPriority (scheduler.development.js:468:1)
at runWithPriority (react-reconciler.development.js:2495:1)
at flushSyncCallbackQueueImpl (react-reconciler.development.js:2541:1)
at flushSyncCallbackQueue (react-reconciler.development.js:2528:1)
at scheduleUpdateOnFiber (react-reconciler.development.js:14421:1)
at Object.updateContainer (react-reconciler.development.js:18229:1)
at render (Canvas.js:19:1)
at Canvas.js:50:1
at commitHookEffectListMount (react-dom.development.js:22969:1)
at commitPassiveMountOnFiber (react-dom.development.js:24702:1)
at commitPassiveMountEffects_complete (react-dom.development.js:24666:1)
at commitPassiveMountEffects_begin (react-dom.development.js:24653:1)
at commitPassiveMountEffects (react-dom.development.js:24641:1)
at flushPassiveEffectsImpl (react-dom.development.js:26848:1)
at flushPassiveEffects (react-dom.development.js:26801:1)
at react-dom.development.js:26597:1
at workLoop (scheduler.development.js:266:1)
at flushWork (scheduler.development.js:239:1)
at performWorkUntilDeadline (scheduler.development.js:533:1)
at run (setImmediate.js:40:1)
at runIfPresent (setImmediate.js:69:1)
at onGlobalMessage (setImmediate.js:109:1)
From looking at this Stack Overflow question about the same error (Uncaught TypeError: dispatcher.useSyncExternalStore is not a function), it seems like it may be related to React 18 support. Does Preact Signals support using React 18 at the moment?
The text was updated successfully, but these errors were encountered:
elliotwaite
changed the title
Doesn't work with React Native Skia
Error when trying to use Preact Signals with React Native Skia
Nov 6, 2022
useSyncExternalStore is a React v18 construct, so yes. Though we use the shim (from the React team) to also support v17.
Ah, okay.
Might be a react-native issue, I don't think anyone's really tested/investigated using Signals with it (to my knowledge, anyways).
I've been testing it out with React Native and it seems to be working as expected in most cases. Here's a Snack demo that demonstrates it working on Android, iOS, and web (using React Native Web).
The only issues I've run into so far are trying to use Preact Signals with React Native Skia or trying to use it with React Navigation (as is mentioned in this issue).
Trying to use
@preact/signals-react
with@shopify/react-native-skia
results in the following error:Steps to reproduce:
yarn
(to install the dependencies)yarn web
(to run the expo web version)You can also comment out the lines that import and use preact signals to see that it works without any errors in that case.
From looking at this Stack Overflow question about the same error (
Uncaught TypeError: dispatcher.useSyncExternalStore is not a function
), it seems like it may be related to React 18 support. Does Preact Signals support using React 18 at the moment?The text was updated successfully, but these errors were encountered: