Javascript Articles

Page 218 of 534

How to work with Alerts Dialog box in ReactNative?

Shilpa S
Shilpa S
Updated on 01-Jul-2021 979 Views

The Alert component helps to show a dialog box i.e., a pop up to the user with a title, message, buttons to know the confirmation from the user based on the message displayed.The basic component of Alert is as follows −Alert.alert('yourtile', 'yourmessage', [yourbuttons], ‘options’)To work with Alert component you need to import it as follows −import { Alert } from 'react-native';To get the pop-up you just have to call the Alert.alert() function. There are four params the alert() takes and it is title, message, buttons and options. The title is mandatory param and rest are optional.Here is a simple example ...

Read More

List some benefits of using React Native for building mobile apps?

Shilpa S
Shilpa S
Updated on 01-Jul-2021 203 Views

The increase in the popularity of IOs and Android apps nowadays there are lots of companies building apps and want them to develop in a faster way. A fully native app is getting very expensive as it requires separate teams to work on iOS and Android. ReactNative is a good solution to this as the app developed in react native can be run on ios and android.React Native is an open source mobile development framework that app developers prefer, to build an app that is cost effective and also saves time.React Native was a Facebook's hackathon project that was meant ...

Read More

What is the SectionList component and how to use it in React Native?

Shilpa S
Shilpa S
Updated on 01-Jul-2021 1K+ Views

An interface that helps to render the lists in sections. Some of the important features of SectionList are −Header/Footer support to the ListHeader/Footer support to the sectionScroll LoadingPull to refreshFully cross-platformThe basic SectionList component looks as follows −To work with SectionList import the component as shown below −import { SectionList } from "react-native";Here is a list of important properties available on a SectionList −PropsDescriptionrenderItemIs the default function that renders the item in the section. It returns a react element.The render function will be passed to sectionlist like an object with following keys −'item'(object) - the item object'index' (number) - Index ...

Read More

What is the FlatList component and how to use it in React Native?

Shilpa S
Shilpa S
Updated on 01-Jul-2021 2K+ Views

FlatList is a container that can be used to load the list items. It offers header and footer support, multiple column support, comes with vertical/horizontal scrolling, lazy loading etc.Here are some important features of FlatList −Comes with scroll loadingAble to adjust the scroll by using ScrolltoIndex supportComes with header and footer supportMultiple column supportCross platformConfigurable viewability callbacksThe Basic structure of FlatList is as follows − item.id} />FlatList is implemented from the VirtualizedList component that takes care of displaying a limited number of items that will fit in the current view port of your mobile screen. The rest of the data ...

Read More

How to add styling or css to your app using reactnative?

Shilpa S
Shilpa S
Updated on 01-Jul-2021 340 Views

Styling your app can be done as follows −Using Stylesheet componentUsing Inline stylesUsing Stylesheet componentReact native Stylesheet component comes very handy and neat when you want to apply styling to your app. To work with Stylesheet component first import it as shown below −import { StyleSheet } from 'react-native';You can create the style using Stylesheet component as follows −const styles = StyleSheet.create({    container: {       flex: 1,       marginTop: StatusBar.currentHeight || 0,    },    item: {       margin: 10,       padding: 20,       marginVertical: 8,       ...

Read More

What are props in react native?

Shilpa S
Shilpa S
Updated on 01-Jul-2021 509 Views

Props are properties that help to modify the react component. The component created can be used with different parameters using props concept. With props you can pass the information from one component to another and at the same time re-use the component as per your requirement.You will be familiar with props if you are well versed with ReactJS, the same concepts follow in React Native.Let us take a look at an example that explains what props are.Example 1: Props inside React Native Built-in ComponentsConsider the Image component −The style and source are properties i.e props for the image component. The ...

Read More

List the important core components of React Native

Shilpa S
Shilpa S
Updated on 01-Jul-2021 502 Views

The most important core components in react native are as follows −React Native componentAndroid Native ViewIOS Native ViewWeb BrowserDescriptionView - When the app is seen in Android device the component will be changed to when the app is seen in IOS device the component will be changed to When seen in a web browser the component will be changed to tagIt is the core container that supports flexbox layout. It also manages touch handling.Text - When the app is seen in Android device the component will be changed to when the app is seen in ...

Read More

crypto.privateDecrypt() Method in Node.js

Mayank Agarwal
Mayank Agarwal
Updated on 20-May-2021 2K+ Views

The crypto.privateDecrypt() is used for decrypting the given data content by using a private key passed in the parameter that was previously encrypted using the corresponding public key with crypto.publicEncrypt() method.Syntaxcrypto.privateDecrypt(privateKey, buffer)ParametersThe above parameters are described as below −key – It can contain the below 5 types of data of the following type – Object, String, Buffer or KeyObject.oaepHash – This field contains the hash function to be used for OAEP padding and MGF1. Default value is: 'sha1'.oaepLabel – This field contains the value for OAEP padding. No lable is used if not specified.padding – This is an optional value defined in crypto.constants.buffer – This ...

Read More

Stream writable.writableObjectMode Property in Node.js

Mayank Agarwal
Mayank Agarwal
Updated on 20-May-2021 254 Views

The writable.writableObjectMode property is used for getting the objectMode property of the given writable Stream. The property will return 'true' if the object mode is set, else 'false' will be returned.Syntaxwriteable.writableObjectModeExampleCreate a file with name – writableObjectMode.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −node writableObjectMode.jswritableObjectMode.js Live Demo// Program to demonstrate writable.writableObjectMode property // Importing the stream module const stream = require('stream'); // Setting the objectMode to true objectMode: true // Creating a data stream with writable const writable = new stream.Writable({   ...

Read More

Stream writable.writableLength Property in Node.js

Mayank Agarwal
Mayank Agarwal
Updated on 20-May-2021 284 Views

The writable.writableLength property is used for displaying the number of bytes or objects which are there in the queue that are ready to be written. This is used for inspecting the data as per the status from highWaterMark.Syntaxwriteable.writableLengthExample 1Create a file with name – writableLength.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −node writableLength.js Live Demo// Program to demonstrate writable.writableLength method const stream = require('stream'); // Creating a data stream with writable const writable = new stream.Writable({    // Writing the data from stream ...

Read More
Showing 2171–2180 of 5,338 articles
« Prev 1 216 217 218 219 220 534 Next »
Advertisements