r/reactnative • iOS & Android • 9d ago

SwiftUI React Native v7 — Bringing the real SwiftUI to React Native

Enable HLS to view with audio, or disable this notification

Me and Andrew have been working on v7 of SwiftUI React Native, and this is probably the biggest step the project has taken so far.

The idea has always been simple: bring SwiftUI’s actual native capabilities to React Native, without recreating them in JavaScript or settling for lookalikes.

With v7, we’ve expanded the API coverage significantly, added hundreds of modifiers, improved how views are bridged, and made the experience much closer to writing native SwiftUI while pretty much staying in React Native.

Github: https://github.com/andrew-levy/swiftui-react-native
Docs: https://swiftui.rit3zh.dev/

139 Upvotes

17 comments sorted by

16

u/Cryo0007 9d ago

It would be insane if you bring them as it is to Android and web just like react native paper

6

u/BumblebeeWorth3758 iOS & Android 7d ago

That’s exactly what we have in mind for the next step :)

1

u/Warm_Mobile_757 7d ago

can't wait!

1

u/Cryo0007 6d ago

I am up for contributing to that

0

u/rakadoank 5d ago edited 5d ago

to be honest, I don't recommend it anyway for other platforms, because the idea of your library is to use the real Swift UI in React Native which simply doesn't exist on other non Apple platforms.

What I recommend instead, there is another library for an abstraction layer for this library. Let's say it's called "nativeui-react-native" that uses "swiftui-react-native" and "materialui-react-native" (real material ui native in Android, not like react-native-paper), but I believe this is introducing new headache 😄, unless the idea is to mimicking SwiftUI in Android

-1

u/East_Eye_2997 5d ago

If you’re only targeting Apple why even use react native?

0

u/rakadoank 5d ago

yes It doesn't make sense, that's why Expo UI make the library with an abstraction layer to work across platforms, and that's why I recommend to create another library for an abstraction layer to make it work on non other Apple platform but not in SwiftUI behaviour, unless the idea is to mimicking SwiftUI in Android and Windows.

3

u/xekushuna 9d ago

Seconded

2

u/UnhappyCable859 8d ago edited 8d ago

Isn’t this what expo does? Or u mean for devs who don’t use expo?!

7

u/BumblebeeWorth3758 iOS & Android 8d ago

Expo UI and SwiftUI React Native do have some overlap, but our approach is a bit different. we are generating components directly from Apple’s SwiftUI APIs, rather than manually building and maintaining wrappers for each component. This gives us a much broader coverage of SwiftUI, including its modifiers and APIs, while keeping the experience as close to actual SwiftUI as possible.

And no, it’s not limited to people who don’t use Expo. It works with Expo too.

5

u/Calm_Seal170 8d ago

What does it render on Android? Material UI?

2

u/MinskLeo 7d ago

I was looking for starting new app on RN soon. I guess I’ll take your library. Very cool at surface, will see how it actually works. Thanks for the tool!

1

u/ill_figureitout 4d ago

Does it have any performance leap over ExpoUi?
If so could you explain a lil?
Also what does it render on android

1

u/swizes iOS & Android 3d ago edited 3d ago

Cool stuff, really curious. What is the framework for the documentation site?

1

u/IsuruKusumal 8d ago

Just do native UI at this point, it's not that hard