andrew-levy / swiftui-react-native

Bringing SwiftUI features to your React Native app. It's like if React Native and SwiftUI had a child.
swiftui-react-native.vercel.app
MIT License
614 stars 22 forks source link

Use Expo Module API #26

Closed andrew-levy closed 4 months ago

andrew-levy commented 1 year ago

Once SwiftUI views are supported in the module api (early 2023 maybe?), I would like to switch some components over to it rather than using javascript implementations. Good candidates include:

Maybe:

Notice this list doesn't include any container views like Stacks, this is because there currently isn't an easy way to pass children from RN to the SwiftUI view. This will likely come in later iterations of the module api.

Questions:

Track PR: https://github.com/expo/expo/pull/19888

zpg6 commented 1 year ago

Very cool!

landonwjohnson commented 1 year ago

does this work with expo and web projects? I have been learning SwiftUI in my free time and I stumbled upon this project, it looks cool!

andrew-levy commented 1 year ago

Hey @landonwjohnson thanks! This does work with Expo projects, just not the Expo Go app. You'll need to create a custom dev client since this library relies on a native module (sf symbols). I've never tried to use it in a web app, so I'm not too sure. Maybe you can try and let me know? I'm sure it wouldn't be optimized for web by default, tho.

andrew-levy commented 1 year ago

But if you want it to work with the expo go app, i think you can just not install the sf symbol package. I have to check, but im pretty sure the app can handle not having that as a dependency (via dynamic imports)

landonwjohnson commented 1 year ago

@andrew-levy if you could get the date picker, and action sheet implemented. That would be wild!! I might use this in my next upcoming project though.

andrew-levy commented 1 year ago

Let me know how it goes! I'd be happy to help with any bugs you may find along the way. A few things: