Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine Xamarin and React Native in one app

Would it be possible to use React Native and Xamarin in one app.

You can look at this in two ways.

  1. Embed react-native in a Xamarin app. This would mean creating a binding to RCTRootView in such a way that Xamarin can initialize it and load the js bundle. Does this mean that all other react types need to be bound as well? Or would RCTRootView be sufficient?
  2. If you look at it the other way: would it be possible to write native view (be it Android Views or iOS UIViews) using Xamarin and make react-native use them? This will probably also involve some sort of binding as well because this needs an RCTViewManager on iOS or ViewManager on Android.

Why would you want to do this? Maybe because you want to extend an existing Xamarin app with a new section in react native. Maybe because you like writing customer views better in C# than in Swift or Java. Or maybe just because you want to convolute things ;-)

So are there technical issues which would make this impossible (like macro's)? Or is this technically possible but just very cumbersome to get going? Or can this be done?

like image 851
Thomas Avatar asked Jul 01 '16 12:07

Thomas


People also ask

Can we use React Native with Xamarin?

Development languages Xamarin uses . Net languages, such as C# and F#, which are common languages and can be used to write native platform code. React Native uses JavaScript, which was not invented for it, but it still does a great job with React Native apps.

Can I combine react and React Native?

As long as we are building our application purely within the framework, we can drive our app with properties and callbacks. But, when we mix React Native and native components, we need some specific, cross-language mechanisms that would allow us to pass information between them.

Is Xamarin better than React Native?

Though both Xamarin and React Native offer near-native performance, Xamarin runs the fastest code on Android and iOS and has a user interface (UI) for using native tools. TLDR: In Xamarin vs. React Native, Xamarin has more brownie points for native-like performance. Xamarin wins.

Does Xamarin build native apps?

Moreover, Xamarin is native, and because it gives access to 100 percent of the native APIs, developers can also create Android wear apps, Apple Watch apps, and Apple TV apps.


1 Answers

How to integrate a React Native View into any existing iOS or Android application is well documented, so this should definitely be possible.

You may want to also take a look at Wix's react-native-navigation as they have broken out of the standard "unique view" from React Native.

Also, someone made it possible to use Cordova plugins in a React Native application, as an example on how to do it the other way around.

like image 110
damusnet Avatar answered Sep 22 '22 02:09

damusnet