REACT NATIVE

What is React?
React is a JavaScript library for building user interfaces. It is quite simple because React.JS is simply library concerned with components utilizing the expressiveness of JavaScript intermixed with an HTML-like template syntax. If you consider a typical Web application through the prism of the Model View Controller, React is simply giving you the V of MVC. You may read that and think so it’s a template engine like HandleBars or Jade then. No, this is more than your typical template engine library due to how much it leverages JavaScript to get things done.

React uses JavaScript to create components through JSX. JSX is a language that looks like HTML, but ultimately compiles down to JavaScript statements. JSX is syntactic sugar to make creating HTML components easier to work with. Truthfully, there are only minor differences between HTML and JSX

Rendering components as JSX

const App = React.createClass({

render: function () {

return (

<div className=’container’>

<h1> Hello, React! </h1>

</div>

);

}

});

ReactDOM.render(<App />, document.findElementById(‘app’));

Rendering components as JavaScript

const App = React.createClass({

render: function () {

return React.createElement(

“div”,

null,

” This is JSX syntax! “

);

}

});

What is React Native?

With React Native, you don’t build a mobile web app, or HTML5 app, or a hybrid app like Cordova, Ionic and others. You build a mobile app that’s indistinguishable from an app built using Objective-C or Java. React Native uses the same basic UI building blocks as any regular iOS and Android apps. You just put those building blocks together using JavaScript and React.

React Native primarily bring the power of the React programming technique to mobile app development. It is not aiming to be a cross platform, write-once run-anywhere, tool. It is aiming to be learn-once write-anywhere.

Flux Architecture (React and React Native user flex as a architecture)

Why React Native?

Nowadays we can find decent numbers of hybrid apps like Xamarine, Appcelerator Titanium, Ionic and more. Some of the new things in React Native can be highlighted by discovering its pros and cons.

Pros

React native allows you to create native apps by generating native views with JavaScript instead of using a web wrapper.
React Native works by using JavaScript code to manage native views. A “View” in React Native is “UIView” in iOS, and a native “View” in Android at runtime.
The one-way data flow, makes it more predictable and easy to control.
Hot reloading capability of React Native.
Layout in React Native is implemented with CSS-like stylesheets that allow you to specify border widths and margins, colours and fonts.
JavaScript is great for its flexibility, but it offers no enforcement of inheritance or strict typing. To structure your code, react native uses something called Flux. Flux is an application architecture that sits neatly with regular React and React Native application development
Cons

React Native is a relatively young.
React Native is heavily in development, and a new version is released every month, so this requires vigilant updates to code after the logic of the prebuilt components changes.
When the functionality you need, which is not available in the library, we need to create a new module or need to submit a request.
React Native is not the beginner-friendly framework for creating mobile apps with JavaScript. It requires developers to know React, which is known to have a steep learning curve.
In performance, React Native stays behind an optimized native application but better than other hybrid platforms.

There are ways to bring it closer to native performance, like moving animations to native threads (which is currently in under testing by react native team), optimizing JavaScript code, and moving processing-intensive tasks to native modules and separate threads.

Contact Us

If you’d like us to contact you, please fill out the form.

Not readable? Change text. captcha txt