Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
React Native Articles
Page 2 of 3
How to display loading indicator in React Native?
Loading indicators are essential UI components that inform users when a request is processing. In React Native, the ActivityIndicator component provides an elegant solution for displaying loading states during API calls, form submissions, or data fetching operations. Import Statement To use the ActivityIndicator, import it from React Native: import { ActivityIndicator } from 'react-native'; Basic Syntax Properties Property Description Type ...
Read MoreHow to show ProgressBar in ReactNative?
ProgressBar is a way to tell users that the content will be available in sometime. It can best be used when you submit something to the server and wait for the server to respond. To work with the progress bar component install react-native-paper module using npm. The command to install react-native-paper is − npm install --save-dev react-native-paper Basic Syntax The basic component of progress bar is as follows− To work with Progress Bar you need to import it from react-native-paper as follows − import { ProgressBar} ...
Read MoreExplain the importance of SafeViewArea in React Native?
The SafeAreaView component in React Native ensures your content displays within the safe boundaries of a device screen. It automatically adds padding to prevent content from being covered by system elements like the status bar, navigation bar, toolbar, and tab bars. While originally designed for iOS devices with notches and home indicators, it's now essential for modern app development across platforms. The Problem Without SafeAreaView When using regular View components, content can render underneath system UI elements, making it partially or completely hidden from users. Example: Text Overlapping Status Bar The following example shows how text ...
Read MoreHow to display dropdown in ReactNative?
React Native provides the Picker component (now deprecated) and modern alternatives for creating dropdown selections. This guide covers both approaches. Basic Picker Syntax The traditional Picker component follows this structure: Import the Picker component from React Native: import { Picker } from 'react-native' Picker Properties Property Description enabled Boolean value. If false, picker is disabled and user cannot select items. itemStyle Styling to be applied to picker items. ...
Read MoreExplain VirtualizedList component usage in ReactNative?
The VirtualizedList component is React Native's most performance-optimized component for rendering large datasets. Unlike regular lists that render all items at once, VirtualizedList only renders visible items and recycles components as users scroll, dramatically improving memory usage and scroll performance. The basic structure of VirtualizedList requires several mandatory props: Essential VirtualizedList Properties Props Description ...
Read MoreHow to handle navigation from one page to another in react native?
While working on the app, we would like to switch from one screen to another and that is handled by React Navigation library. Installation To work on navigating pages we need to install few packages as follows: npm install @react-navigation/native @react-navigation/stack npm install @react-native-community/masked-view react-native-screens react-native-safe-area-context react-native-gesture-handler Once you are done with the above installation let us now proceed with the next setup of navigation in React Native. Creating Page Components In your app project create a folder called pages/. Create 2 js files HomePage.js and AboutPage.js. pages/HomePage.js import ...
Read MoreHow to handle errors while working with Navigation in ReactNative?
Problem: How to handle the error "A navigator can only contain 'Screen' components as its direct children" while working with Navigation in ReactNative? Solution While working on your app you may come across issues like stated above. Here we'll understand why such error comes up and what can be done to avoid it. Here is the code that gives us the error: Example with Error App.js import * as React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import { Button, View, Alert, Text } from 'react-native'; ...
Read MoreHow to handle the error "Text strings must be rendered within a component" in ReactNative?
The "Text strings must be rendered within a component" error in React Native occurs when text or strings are placed outside of proper text components. This error typically happens due to formatting issues, improper indentation, or invisible characters in your JSX code. Common Causes This error commonly occurs due to: Bad indentation - Improper spacing that confuses the JSX parser Trailing spaces - Invisible whitespace characters at the end of lines Copy-paste issues - Hidden characters from external sources Text outside ...
Read MoreExplain ReactNative SwitchSelector Component
SwitchSelector is a React Native component that functions like a radio toggle button, allowing users to select from multiple options (more than 2). It's particularly useful for creating segmented controls and option selectors in mobile applications. Installation To work with SwitchSelector, you need to install the package: npm i react-native-switch-selector --save-dev Basic Syntax The basic SwitchSelector structure looks as follows: console.log(`value selected is : ${value}`)} /> Properties Here are the important properties of SwitchSelector: ...
Read MoreHow to display date and time picker in ReactNative?
To display date and time picker in your React Native app, you need to install the community package as it's not included in React Native core. Installation npm install @react-native-community/datetimepicker --save Once installed, you can import and use the DateTimePicker component in your app. Import Statement import DateTimePicker from '@react-native-community/datetimepicker'; Basic Syntax Key Properties Props ...
Read More