React Native current architecture
The React Native library allows you to create native applications with React and JS by utilizing native building blocks. For instance, the <Image/>
component represents two other native components, ImageView
on Android and UIImageView
on iOS. This is viable because of the architecture of React Native, which includes two dedicated layers, represented by JS and Native threads:
Figure 16.4: React Native threads
In the next sections, we will explore each thread and see how they can communicate, ensuring that JS is integrated into the native code.
JS as part of React Native
As the browser executes JS through JS engines such as V8, SpiderMonkey, and others, React Native also contains a JS virtual machine. There, our JS code is executed, API calls are made, touch events are processed, and many other processes occur.
Initially, React Native only supported Apple’s JavaScriptCore virtual machine. With iOS devices, this...