React-Native is one of the widely used libraries for developing Android and iOS applications. In the recent past, most of the developers prefer to use react-native because it makes development simple and easy. However, reading this article you will get to know the working of react-native in detail. But before we go deep into React-native you must need to know about React.
What Do You Mean By React?
React library is smart enough to figure out the components required to be rendered on the basis of data change. This makes react to be fast and powerful and this is the reason why it is appreciated by the developers in the field of web applications.
Understanding About React Native
Working Of React-Native
It comprises of four different kinds of threads. The below section will discuss the function of each thread in React-Native application
UI-thread: This thread is the main thread in React-Native used for native Android and IOS user interface development. For example, when it is used to render Android the UI thread helps in measuring layout and drawing.
Native Module thread: at times the application requires access to the platform API and this method is a part of the native module thread
Render thread: the react-native render is only used in Android l to produce the actual OpenGL comments for drawing the user interface.
What is the Process Involved in the Working of React-Native
- When the application starts the execution of the main thread occurs which starts loading the JS bundles
- Once the code is loaded successfully the next thread that is the JS thread comes into play
- The calculation is done by the shadow thread which in turn sends the parameter of the layouts and objects to the main UI thread
- The main thread responsible for rendering the things on the screen is Shadow thread which must generate the layout to the main thread and the main thread indicates that on the screen
The working of React-Native and why react-native is gaining popularity as a Framework in the development platform is discussed with relevant facts. There are a lot of benefits of using it in development cross-platform for mobile applications.
A lot of topics could be covered under react-native. If you have any idea you can let us know in the comment section.