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.
What are the benefits of React Native apps?
Here we are listed few benefits of React Native language
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,
How many threads we have in React Native?
Basically React Native has 3 types of Threads
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
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 genericScrollView
, theFlatList
only renders elements that are currently showing on the screen, not all the elements at once.The
FlatList
component requires two props:data
andrenderItem
.data
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
Ruby program to add two integer numbers
how to create an array with Array.[](*args) in Ruby ?
What are the various Ruby runtimes, and how are they different?
Ruby program to check whether the given number is prime or not
Ruby program to reverse a string
Ruby program to check whether the given number is palindrome
Ruby program to print Fibonacci series
How to Replace array elements in Ruby?
Ruby program to print an array
Ruby program to check whether the given number is Armstrong
Program to Print Triangle of Numbers in Ruby
How to add/remove elements to Array in Ruby?
How to shuffle an array in Ruby?
Creating Array with Array.new(size, obj) in Ruby
Ruby program to generate random numbers
Ruby program to Calculate the factorial of given number
What are #method_missing and #send? Why are they useful?
How to Sort Array in Ruby?
How to get index of array element in Ruby
How to Get Input with Gets in Ruby
How to create two dimensional array in ruby?
Reat Native Google Maps integration