I'm not sure if this is the best forum to ask, but I'm struggling to find any documentation for this.
Is it possible to integrative react-native-windows
into existing UWP applications?
Something like https://facebook.github.io/react-native/docs/integration-with-existing-apps would be what I'm searching for, if it were to exist.
Please let me know if there's somewhere else this question should live and I'll move it there. :)
Bump.
Unfortunately, there are not good docs on this right now, but it is definitely possible. Rather than deriving from the ReactApplication
(the default setup generated by the CLI), you'll need to instantiate and manage the lifecycle of your React Native instance via the ReactNativeHost
class. There's an extension method for ReactNativeHost
- OnCreate
- which will hand you a FrameworkElement (the root view of the React Native app) and call startApplication / render. For passing data back and forth between the "host" UWP app and the embedded react-native app, you can use native modules or initial props.
Interesting. If I ever get the chance to experiment one day, I'll try write up some docs.
Most helpful comment
Unfortunately, there are not good docs on this right now, but it is definitely possible. Rather than deriving from the
ReactApplication
(the default setup generated by the CLI), you'll need to instantiate and manage the lifecycle of your React Native instance via theReactNativeHost
class. There's an extension method forReactNativeHost
-OnCreate
- which will hand you a FrameworkElement (the root view of the React Native app) and call startApplication / render. For passing data back and forth between the "host" UWP app and the embedded react-native app, you can use native modules or initial props.