In this post we will discuss about React Native Interview Questions for the Beginners. By reading this you can give answers in your interview.

This post we will cover Basic Interview questions, for this we don't need to have much knowledge of react.js and JavaScript.

But i assume that you people already knows about react.js and JavaScript

 

10 Basic React Native Interview questions for beginners

What is React Native?

React Native is an open source framework developed by Facebook to build cross-platform mobile applications (Android/iOS) using JavaScript. These applications run natively on both android and ios platforms.

 

10 Basic React Native Interview Questions for beginner

 

What are the benefits of React Native apps?

Here we are listed few benefits of React Native language

  • React Native has some pre defined components, so by using these components we can develop the applications in less time.
  • React Native community is growing very fastley, so that we can get any solution easily from this community.
  • React Native support heart reloading,  This means when we do small changes in the code, it will immediately show on the screen.
  • We can use single code for both platforms Android and iOS

 

Who use React Native?

There are thousands of applications which are developed by React Native. Few applications like Facebook AdsManager, Instagram, F8, Airbnb, Skype, Tesla.

 

What are the core components of React Native?

React Native has lots of pre-defined components, there few are treated as core components,

  • View
  • Image
  • Text
  • Flat
  • List
  • Scroll

 

How many threads we have in React Native?

Basically React Native has 3 types of Threads

  • UI Thread
  • JS Thread
  • Shadow Thread

 

Here UI thread is treated as main thread where our Android and iOS applications will run.

 

On Which thread we can change the UI of the React Native application

  • UI Thread

 

 

What is JSX?

JSX stands for JavaScript xml jsx, which allows us to write html in react and react native components.

 

How do you use style in React Native application?

Every React Native components like view, text, image accepts a style prop which is an object of CSS  rules

The only difference between CSS rules and CSS object is in CSS object  has CSS rules in camel case.

 

import React from 'react';

import {StyleSheet, View, Text} from 'react-native';

import {Component} from 'react';

 

export default class Views extends Component {

  render() {

    return (

      

        

          Header

        

        

          Hello, World!

        

      

    );

  }

}

const mystyle = StyleSheet.create({

  container: {

    flex: 1,

    backgroundColor: '#FAFAFA',

    alignItems: 'center',

    alignContent: 'center',

  },

 

  header: {

    backgroundColor: 'green',

    width: '100%',

    alignContent: 'center',

    alignItems: 'center',

    padding: 20,

  },

  boldText: {

    fontWeight: 'bold',

    color: 'white',

    fontSize: 20,

  },

  text: {

    fontWeight: 'normal',

    color: 'red',

    fontSize: 20,

  },

  body: {

    width: '100%',

    flex: 1,

    backgroundColor: 'yellow',

    padding: 20,

  },

});

 

 

 

When to use Flat List or scroll view?

Suppose we have to render a list of items from an array or list which has a big data then we will sue the Flat List

If the render data is less and then we can go with Scroll View

 

The FlatList component displays a scrolling list of changing, but similarly structured, data. FlatList works well for long lists of data, where the number of items might change over time. Unlike the more generic ScrollView, the FlatList only renders elements that are currently showing on the screen, not all the elements at once.

The FlatList component requires two props: data and renderItemdata is the source of information for the list. renderItem takes one item from the source and returns a formatted component to render

 

 

How do you handle element size in React Native?

In react native all dimensions are unit less, and represents density independent pixels by setting fixed height and width to look same on different size devices. But some times we have to display our component on the percentage based, in that case using the percentage on component is not spotted indirect native, but react native does give a dimension module which can be used to give width in percentage based on mobile devices.

 

What is the use of Platform module in React Native?

The React Native Platform Module is used to detect the platform of the device in which the application is running

 

 

 

 

 

 


Subscribe For Daily Updates