Issue
So, as ýou may assume I want to build an android app. I was contemplating whether to use Kotlin or React Native code, then I saw you can make a bridge with Kotlin and RN. What is the purpose of doing that if simply making a Kotlin/RN app easier to set up?
Solution
You will possibly get a few reasons. But a summary of it is the fact that React Native may not have all the functionality you may require to build a certain type of app.
For example, you may want an app that scans the network for a specific SSID or maybe create your own network configuration profile - within React Native, that may be impossible as of now.
But by building a bridge with native code, you can create this functionality natively, and by having a bridge - you can invoke those functions via React Native.
There may be some features that are not implemented yet in React Native or some device-specific features that are not supported by this development platform. So we can use native modules to fill the gap.
Why do we need native modules in React Native apps?
Who can really say! Maybe you want to make platform-specific code or want to reuse some existing code. For whatever the reason, React Native allows you to create your own native modules and expose them to JavaScript. The whole process is described in depth in the Native Modules Android documentation.
Ref: https://proandroiddev.com/react-native-bridge-with-kotlin-b2afde2f70b
Answered By - Aleksandar Zoric
Answer Checked By - Robin (JavaFixing Admin)