-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
New version of preact signals for react not working with React Native #346
Comments
Signals is working in pure repo. So we will investigate more about it |
I'm having the same issue |
The solution for it is to roll back to 1.2.1 and apply a little patch (if you are using react-navigation) #257 |
same here |
Same for me with fresh Expo project, signals v1.2.2 works though |
I'm checking diff between 1.2.2 and 1.3.0 and... I'm not exactly sure yet but it might be related that signals >=v1.3.0 started to use |
Hint, hint? |
Seems to be one of the reason - wrong function serialization
|
This is not bug - this the feature They are added 'show source' to actually check function code |
We actually can actually patch react-native, but there are many renderers (react-native-skia, three-fiber). I think its blocker in terms of React Native support. Can we give user opportunity to select auto tracking method, because old auto tracking via wrapping each component with proxy working very well in case of react native. Maybe it should be @preact/signals-react-native package, or just "react-native" field in package.json exports |
I'm currently pursuing a method that would use a babel transform on components to track signals instead of patching internals. That should hopefully work better for all renderers. PR for feedback should be out soon (a couple days). |
It would be really interesting. Appreciate your work |
@andrewiggins |
I couldn't even get v1.2.0 to work with my Expo setup, so I ended up just going with Jotai just to get something that works right now: It's not ideal and not as clean, but it works for now, especially if it's a new project and you can't wait for an official patch. |
@andrewiggins when real way to use babel transform will be provided? |
Initial version of babel transform is available at https://npm.im/@preact/signals-react-transform Give it a try and lemme know how it goes. |
But how to use it?). We should install |
The documentation for Perhaps a step back to a simplified approach where there's no patching React? Instead, provide a simple component that can do the optimization? |
How would this work? The issue resides in React's reconciler, any special component you make is subject to the reconciler just as every other component is. |
@andrewiggins what do you think about my concerns? |
In my RN apps, preact signals not working. Previous implementation wasn't working because of navigation.
However its working in expo snack: https://snack.expo.dev/@xantregodlike/funny-pretzel?platform=android
This issue is not reproducing event in pure react native starter. I think it can be related with some external libraries. When i will detect which one is causing this issue - it will add reproduce steps
The text was updated successfully, but these errors were encountered: