3rd party libraries with Swift break, because React-RCTFabric
, React-Codegen
, RCT-Folly
, ... do not define modules
#34
Replies: 2 comments 1 reply
-
Hello @mateusz1913, The new architecture is written in C++ and for React Native to support Swift out of the box, Swift needs to work with C++. At this moment, C++ interoperability is an ongoing effort within Swift project. There seems to be a lot of interest in the space and Swift has been making progress towards the interoperability. When Swift can work with C++, it should be possible to build native components in Swift as the new architecture's API are in C++. For now, you should be able to wrap your Swift component in Obj-C++ native component. It is an extra step where C++ APIs will need to be manually transformed to Swift, but it should work. |
Beta Was this translation helpful? Give feedback.
-
It will probably be resolved with facebook/react-native@709a459 I will mention it in 0.68 & 0.69 releases discussions |
Beta Was this translation helpful? Give feedback.
-
I recently tried to play with creating a simple POC library, that is compatible with "New Architecture", and uses Swift on the iOS side, in order to learn how to migrate my library react-native-avoid-softinput.
When I added Swift files (inside the library directory) and made Pods synchronization in the example project, it failed with:
I found that it was already highlighted by @mrousavy in Playbook PR.
This is a blocker for migration of react-native-avoid-softinput and other libraries that are written in Swift.
Is there some roadmap for
support of Swift libraries with "New Architecture"those pods (RCT-Folly
,ReactCommon
, etc.) to be compatible with Swift code?Beta Was this translation helpful? Give feedback.
All reactions