React Native
React Native is a way to develop mobile apps using React and JS. It means React Native is a cross-platform, in which you can create one mobile app and run on multiple platforms like iOs, Android, windows and blackberry.
React native is a framework developed by Facebook and it is like react, but it uses native components instead of web components as a building blocks form. React native is also called as the next generation of React that uses a JavaScript code library to develop apps. It has built-in access to all the native views and components.

There are 4 important threads in each React Native application:
1) UI Thread- Also known as Main Thread. It handles displaying the elements of native Android and iOS UI rendering. For example, in android this thread is used for android measure/layout/draw happens.
2) JS Thread- JavaScript thread deals with the business logic of the application. e.g.- where JavaScript code is executed, API calls are made, touch event processed and many other logics. Updates to native views are batched and sent over to native side at the end of each event loop in the JS thread and are eventually executed in UI thread.
3) Native Modules Thread- Sometimes some app needs access to platform API, and then use native modules thread to solve this problem.
4) Render Thread -This is Only in Android L (5.0), React Native render thread is used to generate OpenGL commands used to draw your UI.
How do threads interact?
Between UI thread and JS threads, we use the bridge to interact. Bridge work as Asynchronous, Batched, Serializable.
Asynchronous -It enables asynchronous communication between the threads.
Batched-It transfers messages from one thread to the other in an optimized way. They transfer message as a block form.
Serializable-The two threads are different from each other and work is also so different and never share or operate with the same data. Instead, they exchange serialized messages.
Difference between React and React Native:
ReactJS is a JavaScript library, supporting both front-end web and being able to run on a server, for building user interfaces and web applications.
React Native is a mobile framework that compiles to native app components, allowing you to build native mobile applications for different platforms (iOS, Android, and Windows Mobile) in JavaScript that allows you to use ReactJS to build your components, and implements ReactJS under the hood.
Both are open sourced by Facebook.
The React code looks like this:
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
class Clock extends React.Component {
constructor(props) {
super(props);
this.state = {date: new Date()};
}
componentDidMount() {
this.timerID = setInterval(
() => this.tick(),
1000
);
}
componentWillUnmount() {
clearInterval(this.timerID);
}
tick() {
this.setState({
date: new Date()
});
}
render() {
return (
<div>
<h1>Hello, world!</h1>
<h2>It is {this.state.date.toLocaleTimeString()}.</h2>
</div>
);
}
}
ReactDOM.render(
<Clock />,
document.getElementById('root')
);React Native code sample looks like this:
import React, { Component } from 'react';
import { Text, View } from 'react-native';
class WhyReactNativeIsSoGreat extends Component {
render() {
return (
<View>
<Text>
If you like React on the web, you'll like React Native.
</Text>
<Text>
You just use native components like 'View' and 'Text',
instead of web components like 'div' and 'span'.
</Text>
</View>
);
}
}Tags like <View>, <Text>are very frequently used in React-Native while React.js uses web html tags like <div> <h1> <h2>, which are only synonyms in dictionary of web/mobile developments.
Thus, in order to learn React Native one should have knowledge of React and JavaScript.
Resources
React
React Native
