Skip to content
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

we need official static or dynamic react-native library for iOS #728

Open
iTonyYo opened this issue Nov 7, 2023 · 1 comment
Open

we need official static or dynamic react-native library for iOS #728

iTonyYo opened this issue Nov 7, 2023 · 1 comment

Comments

@iTonyYo
Copy link

iTonyYo commented Nov 7, 2023

Why doesn't the official team provide React Native as a static or dynamic library for iOS? This would significantly simplify the integration of native applications.

Integrating React Native into native Android applications is genuinely straightforward; it just requires these configurations,

implementation 'com.facebook.react:react-android:0.72.6'
implementation 'com.facebook.react:hermes-android:0.72.6'

The integration methods mentioned in the official documentation currently involve native developers dealing with node_modules and necessitate moving the native project into the "ios" directory, which is quite unfriendly. It would be better if the official team could provide the React Native as xcframework libraries, allowing native developers to directly import them.

@cipolleschi
Copy link

Hi @iTonyYo, thanks for the question.

I understand your struggle and I do agree that it would be a better world. However, with our current setup, this is not achievable. React Native is a collection of dependent pods from Cocoapods and, as of today, cannot be archived as a single XCFramework. You will have to deal with ~30 separate XCFrameworks and, at that point, it would be much much harder.

We have plan in the future to improve the integration between React Native and Native application, so, please, bear with us.
Meanwhile, Integrating a React Native in an app is a matter of properly create a Podfile using the use_react_native! and the react_native_post_install hook and to extend the RCTAppDelegate class.

As inspiration, you can look at our template.

You should be able to integrate React Native even if the app is not in the ios folder: just pass the proper parameters to the use_react_native! function. We are doing that in the RNTester app, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants