How come React Native is so Native? – Quovantis – Medium

How come React Native is so Native?  #ReactJS

  • This sphere keeps the native feel intact so that it’s hard to tell whether the app is written in native language or React Native.JavaScript SphereIt contains JavaScript code that runs on the separate thread.
  • Well, let’s take a glance at how this wisely designed component works- Any user interaction/event is detected in Native Sphere and it’s straight away passed on to JavaScript sphere via bridge for processing.
  • When it’s done, it serializes the data and sends it back to native sphere via bridge for view rendering.Any pass over the bridge (call from Native to Javascript or from Javascript to Native ) brings down the performance graph.
  • As I mentioned earlier that any activity in JavaScript sphere does not hamper user experience, asynchronous calls make React Native apps highly performant.Serialization- Any communication over the bridge includes exchange of serializable messages.
  • Another sphere will have to keep waiting for the access thereby hampering its seamless code execution.Batch Processing- Under the veil, JavaScript code gets translated into native code after the pass over the bridge.

Before diving into the pool of React Native, I was curious to know how this thing really works under the hood. After all, developers can’t stand any black box and seeing through any abstraction is…

Before diving into the pool of React Native, I was curious to know how this thing really works under the hood. After all, developers can’t stand any black box and seeing through any abstraction is their favorite part. I went through the docs, lectures and conferences before using any of the React Native components. In this blog, I will be sharing my learning with you and I hope you enjoy it.I will illustrate the magic of React Native using two spheres-Native SphereThis is where developers have been playing with Objective C/Swift in iOS and Java/Kotlin in Android. React Native uses the same sphere to render all of its views and it’s done on the main thread. This sphere keeps the native feel intact so that it’s hard to tell whether the app is written in native language or React Native.JavaScript SphereIt contains JavaScript code that runs on the separate thread. Code in this sphere is executed by Javascript Engine. React Native puts business logic of your app and styling of views here. Any code contained here does not block UI and hence user experience remains untroubled.Both spheres play their part at lightning speed. React Native then devised “the bridge” to connect these two code containers and give developers a superpower:“Write once, run anywhere and keep it native”You guys must be wondering “What’s so special about this bridge?”Well, let’s take a glance at how this wisely designed component works- Any user interaction/event is detected in Native Sphere and it’s straight away passed…

How come React Native is so Native? – Quovantis – Medium