I hope, you have already done enough with ReactJS. Now, it's time to work with Native React. When Native React was launched, the response was super awesome and positive. This is the revolution for Mobile Web world. The internet says it was launched on March 2015, so it was just a very new technology. As we know, a country cannot be built in a day, similarly, it applies to the programming language. It takes some time to mature.
When we talk about mobile technologies, two names come to mind- Cordova and Phonegap. Now, they have some drawbacks. Cordova is significantly slower than native Applications, especially for the graphical-heavy Applications.
The key solution is React Native. We can just transform our React Application into React Native but change some elements. The concepts are the same for both React and React Native.
- When we work on a React component, the first thing we notice – our component has to ‘render’ a function. If there is no render function, we get an error.

The best thing is, we never mess with DOM here, but we return a JSX. JSX is XML-based construct, which represents what will be rendered in DOM.
Let's rendor here- <div className="main-component">Hello World</div>

JSX converts XML coding into thefunctions-Thus, the advantange of this is, we can’t render our components anywhere else than inside the “render” function, so there is never the concern that we don’t know where exactly our rendered component came from.- return React.createElement("div", {
- className: "main-component"
- }, "Hello world");
- In addition to props, the components can also have an internal state. The most prominent example of that behavior would be a click counter, which updates its value when a button is pressed. The number of clicks itself would be saved in the state. Each of the prop and state change triggers a complete re-render of the component.
Now, let’s convert our React app into React Native app. Some pre-requirements are needed, as we need OS Mac and X Code. Since iOS is currently the only supported platform, system should have Node.JS pre installed. Install React Native, using-
npm install -g react-native-cli
You can run your ‘FirstNativeApp’, using-
react-native init FirstNativeApp
It creates a FirstNativeApp folder, in which the boilerplate code can be found.
Now, we have a React app, as given below-









Prasanna MuraliPosted Oct 9, 2016, 9:41 AM
Nice post..
Guest UserPosted Oct 9, 2016, 2:51 AM
One thing i noticed, "Each of the prop and state change triggers a complete re-render of the component" ... Prop is immutable and cannot change once set, so I am not sure if it re-render render() function
Guest UserPosted Oct 9, 2016, 2:51 AM
Nice article.