What is React Native?
React Native is a JavaScript Framework for building a rich Mobile Apps and web apps. You can build your mobile apps (applications) using JavaScript & React only with React Native. It uses native components instead of web components as building blocks. It supports mobile platforms like Android and iOS.
[dt_sc_button type=”type1″ link=”http://www.interviewgig.com/discussion-room/post-a-question/” size=”large” bgcolor=”#7ed640″ textcolor=”#ffffff” target=”_blank” timeline_button=”no”]Post a Question[/dt_sc_button]
Why React Native?
- React native written in JavaScript and easy to use.
- React Native is an opensource framework, which could be compatible with windows or tvOS platforms in the near future.
- Reused native components
- Code sharing
- Cross platform compatibility
- Easy to build Android and iOS apps.
- For mobile apps: No need to learn java, iOS swift programming’s (only using Javascript, HTML, and CSS both Android and iOS)
- React Native is a User Interface (UI) focused, which makes the applications ()apps load quickly & fast and gives a smother feel.
Write a code Hello world in React Native?
Sample Hello World Program in React Native for Mobile apps:
import React, { Component } from ‘react’;
import { Text, View } from ‘react-native’;
export default class HelloWorldApp extends Component {
 render() {
   return (
     <View>
       <Text>Hello World</Text>
     </View>
};
}
}
Output: Hello World
Â
What are the big companies used in React Native?
- Facebook: Facebook ads manger, Facebook Analytics
- Wal-Mart
- Uber
- Instagram
- Skype
- Pinterest
- Adidas GLITCH
- Baidu Mobile
- Tencent QQ
- JD
- wix.com
- delivery.com and more.
What is the Props?
Props are used to customize the components by giving them different parameters. Each component has its infrequent ability to customize the component.
What does StyleSheet.create do?
StyleSheet.create method ensures that values are immutable and opaque, they are also only created once.
What is State?
State is a triggering method which is used to refresh or update values in the component.
What is native apps means?
A native app is a program that has been coded in a specific programming language like Objective –C, java, Swift etc. It live on the device and are accessed through icons on the device home screen. Native mobile applications provide fast performance and a high degree of reliability. Native apps are installed through an application store (such as Google Play or Apple’s App Store). It supports both online and offline transactions.
What is a Hybrid app?
A hybrid app is a program that is built using HTML 5, CSS and JavaScript and wrapped in native container.
What is HOC?
HOC (Higher Order Component) is an advanced technique in React for reusing component logic. Hoc is a function that takes a component and returns a new component.
Why animation very clear in React Native?
The animated API was designed with a very important constraint in mind, it is serializable. This means we can send everything about the animation to native before it has even started and allows native code to perform the animation on the UI thread without having to go through the bridge on every frame. It is very useful because once the animation has started, the JS thread can be blocked and the animation will still run smoothly. React Native provides extremely smooth animations because the code is converted to native views before rendering.
How Virtual DOM works in React Native?
React creates an in-memory data structure cache, computes the resulting differences, and then updates the browser’s displayed DOM efficiently. This allows developers to write code as if the entire page is rendered on each change while the React libraries only render subcomponents that actually change.
Is React Native a native mobile App?
Yes, React Native compiles a native mobile app using native app components. It’s neither a Hybrid Mobile app that uses Web View to run the HTML5 app or a mobile web app. React Native builds a real mobile app that’s indistinguishable from an app built using Objective-C or Java.
What is the difference between ReactJS and React Native?
ReactJS is a JavaScript framework used for developing mobile or web apps in HTML5 using JavaScript language.
React Native is used to develop native mobile apps using JavaScript language.
What are Refs in React?
Refs are an escape hatch which allows you to get direct access to a DOM element or an instance of a component. In order to use them you add a ref attribute to your component whose value is a callback function which will receive the underlying DOM element or the mounted instance of the component as its first argument.
When should I start using Redux with React Native?
Unless your app is a video game or dealing with only a handful of entirely disconnected views, I can’t imagine a situation where shared global state is not required. Even shifting from one active tab to another can be seen as a global state change. If you end up using react-navigation, redux can be easily incorporated as part of the project setup
Which node_modules will run in React Native?
In React Native, any pure JavaScript libarary that does not rely on node.js runtime modules .and does not rely on web specific concepts like window.location.pathname will run fine. But we have to be mindful because there’s no way to test for this with Babel—it doesn’t scan these libraries for offending dependencies. A module that uses window.location.pathname may fail at runtime in a different unexpected place.
What are the key advantages of React Native?
- It is free and opensource
- Community driven
- Single code used
- Code sharing in different platforms
- Cost saving and reuse code
- Live reload or preview
- Hybrid apps native performance
- Increase development speed
- Modular and intuitive architecture similar to React
What are the Cons of React Native?
- Memory management
- Security problem
- Single threadedness
- Native code required (Not support all native APIs)
- Depended on third party libraries
- App performance: React Native apps are not equivalent to true native apps written entirely in Swift/Obj-C or Java.
( React Native:Not at all the times, there may be many changes in the future.)