State is the place where the data comes from. We should always try to make our state as simple as possible and minimize the number of stateful components. If we have, for example, ten components that need data from the state, we should create one container component that will keep the state for all of them.Example 1Button title changing to ON/OFF when the user presses the button.The state is initialized inside the constructor as shown below −constructor(props) { super(props); this.state = { isToggle: true }; }The isToggle is the boolean value given to the state. The title of ... Read More
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
React Native is an open source JavaScript Mobile framework from Facebook specially designed to build native mobile apps for iOS and Android. React Native is based on ReactJS JavaScript library that helps to build the user interface for mobile platforms.React Native can be directly used inside an existing IOS or android app or you can build a native app right from scratch. At present React Native is used with some popular apps like Facebook mobile app, Instagram, Pinterest, Skype, etc.Some important features of React Native that makes it a very popular mobile development app today are −Cross Platform Support − ... Read More
The mkdir command is used to create a new directory in the Linux/Unix operating system. It is also used to create more than one directory at a time and set the permission for the directories just like the chmod command in the Linux system.SyntaxThe general syntax of the mkdir command is as follows −$ mkdir [OPTION]... [DIRECTORIES]...Brief description of options available in the mkdir command.Sr.No.Option & Description1-m, --mode=MODESet the mode of file as the time of directory creation just like the chmod command2-p, --parentsNo message prompt if existing and make parent directories as needed3-v, --verbosePrint what is being done4-ZBy default, ... Read More
In this article, we will learn to copy a file or directory in the Linux/Unix operating system using terminal, we use the cp command to copy a file or directory in the Linux system.cp (copy) - The cp command is used to copy files or directories in the Linux system. If we want to copy a file from a source directory and paste it into another destination directory then we have to use the cp command. By default, the cp command will not copy directories to copy directories we have to use -R option with cp command otherwise error will be ... Read More
While working with files, sometimes a situation occurs that a file contains many tabs and the requirement is a file in which no tabs but with space. In this case, if a file is quite simple then work is easy but if we are dealing with a long file then it’s very tough work.To convert tabs to spaces, we use the expand command in the Linux system. If file is not given then the expand command read standard input.SyntaxThe general syntax of the expand command as follows −expand [OPTION]... [FILE]...Brief description of options available in the expand command.Sr.No.Option & Description1-i, ... Read More
To compare two sorted files, we use the comm command in the Linux system.The comm command is used to compare two sorted files line by line and writes three columns to standard output. The first two columns contain lines unique to the first and the second file and the last column contains lines common to both. Columns are distinguished with the tab. The functionality of the comm command is similar to the diff command.SyntaxThe general syntax of the comm command is as follows −comm [OPTION]... FILE1 FILE2Brief description of options available in the comm command.Sr.No.Option & Description1-1Suppress first column (lines ... Read More
In the Linux/Unix system to check storage details, we use the df command.df (disk free) command the df command is used to report file system disk space usage using the terminal in the Linux system. It displays total space, used space, and available space.SyntaxThe general syntax of the df command is as follow:$ df [OPTION]... [FILE]...Brief description of options available in the df command.Sr.No.Option & Description1-a, --allInclude duplicate, pseudo, inaccessible file systems2-B, --block-size=SIZEScale sizes before printing3-h, --human-readableDisplay sizes in powers of 10244-H, --siDisplay sizes in powers of 10005-l, --localLimit listing to local file systems6--no-syncDon’t synchronize before getting usage info7--syncSynchronize before getting ... Read More
To change the shell working directory, we use the cd command in the Linux system.cd (change directory) The cd command used to change the current working directory in the Linux/Unix operating system. In the Windows operating system for the same purpose the cd or chdir command available. The cd command also available in the EFI shell (Extensible Firmware Shell). By default, the current shell working directory is home directory.SyntaxThe general syntax of the cd command is as follows −cd [-L| [-P [-e]] [-@]] [directory]A brief description of options available in the cd command.Sr.No.Option & Description1-LForce soft links to as followedResolve symbolic ... Read More
We know that the Linux/Unix is a multiuser operating system files and directories are associated with permission so that only authorized users can access the files.The chmod command is used to change the access permission of files or directories.SyntaxThe general syntax of the chmod command is as follows −chmod [OPTION]... [Mode]... [File]...Syntax of chmod command is as followed, it contains some three parameters that will help to set or change the permission of the file.We will discuss each parameter in detail so that you can have a better idea of using the chmod command.A brief description of options available in ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP