I wrote my app using native method, currently I want to use reactive native in our further development to avoid writing two copies of code for iOS and Android.
The problem is we can't completely rewrite all the code, we want to replace the project piece by piece.
So I am wondering if I can write some views of my project using reactive native and others remain native code that we have used a long time.
If this is possible, is there any existing tutorial about how to do this?
One of the remarkable facts about React-Native is that it's not only about building Native IOS/Android apps, but we can also build web applications using the same code and share more than 50% of codes between React-Native(Mobile) and React(Web) because we use React and JavaScript in both cases.
React Native does not expose a JavaScript API to communicate with the native calendar libraries. However, through native modules, you can write native code that communicates with native calendar APIs. Then you can invoke that native code through JavaScript in your React Native application.
Running your React Native application On Android, use the Expo Go app to scan the QR code from your terminal to open your project.
As others have mentioned there's no quick way to convert react to react-native. A possible alternative if you want your react app to run on a mobile device without rewriting your codebase is to use Cordova. For fun I ported a react-web app into a mobile app using Cordova in just a few minutes.
You can keep your originally written native code via native modules. You can port your current project pieces by pieces to native modules, then let React-Native have access to it.
I guess best option is, start a new React-Native project and make it access your native modules, you won't have to rewrite everything then.
Here is more info for Android and iOS
There is official documentation to this. Checkout:
https://facebook.github.io/react-native/docs/integration-with-existing-apps.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With