should it run on react-native?
ph4un00b opened this issue · 12 comments
Hi, thanks for trying!
Technically, it should work on RN, but I never tried.
Can you create a small reproduction with expo snack?
hi Mr @dai-shi The jsxImportSource jotai-signal directive is not functioning in the expo snack that I have set up over here.
but it seems like the same issue.
https://snack.expo.dev/@phau/healthy-donut
If you need anything else, please let me know.
I hope to find some time to work on it. It will take a while.
Hi, I tried to reproduce the bug locally, but it works well locally.
I downloaded the expo snack and run locally on web and iOS.
Also tried, codesandbox with react-native-web: https://codesandbox.io/s/priceless-star-kg7dmh?file=/src/App.js, it's working well.
What's missing? Can you help creating a reproduction?
Hi Mr., As I can see, a number of things happened last week.
- A new version of the Expo SDK was released. (48)
- I updated Expo GO's test client on my end devices with that fresh release.
- Currently, the hand-compiled signals performed fairly well. Surprisingly, several of my projects using SDK 47 are also working, that's cool!
- I've built up a basic repository with typescript and a web branch, and they function flawlessly on compiled binaries (for example on my low tier android device) as well.
The updated clients and the new SDK may result in improved compatibility.
I can't reproduce a not working sample anymore, the expo snack is the only way at the moment.
The only remaining issue is that the $(atom) shape is unable to function properly.
I think you just forgot the jsx pragma?
diff --git a/App.tsx b/App.tsx
index 3271b1c..8427f78 100644
--- a/App.tsx
+++ b/App.tsx
@@ -1,3 +1,5 @@
+/** @jsxImportSource jotai-signal */
+
import { Text, View, StyleSheet, Button } from "react-native";
import { atom } from "jotai/vanilla";
import { useAtom, useSetAtom } from "jotai/react";
Yes, adding up the jsx pragma on the web, aka react-native-web, works really well 👾.
I also included the samples for hide/show and atom-signal and all worked on the web side.
📲Device mode is where the issue lies because Expo Go produces an error.
I added the "jsxImportSource" on my tsconfig with no luck.
and only the handcompiled signals worked
that syntax error is due to that the bundler can't resolve jotai-signal/jsx-runtime
. maybe, you need something in metro config.
Absolutely true, Mr. the jotai-signal configuration I introduced seems to have made all the difference; awesome! 🎉
I suppose we could end this issue.
@ph4un00b that's great to know. thanks.
@muhammadaasim from zustandjs/zustand-signal#13, this issue should be helpful for you.