Open elliotwaite opened 1 year ago
Does Preact Signals support using React 18 at the moment?
useSyncExternalStore
is a React v18 construct, so yes. Though we use the shim (from the React team) to also support v17.
Might be a react-native issue, I don't think anyone's really tested/investigated using Signals with it (to my knowledge, anyways).
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?