Skip to main content

Posts

Showing posts with the label react native modal popup example

React Native Modal Popup Tutorial

Hi dev, Today, I will learn you how to create modal popup in react native. You can easily create modal in react native. First i will import namespace Modal , after I will make modal using modalVisible method in react native. Here, I will give you full example for simply display modal using react native as bellow. Step 1 - Create project In the first step Run the following command for create project. expo init Modal Step 2 - App.js In this step, You will open App.js file and put the code. import React, { Component } from "react"; import { Alert,Modal,StyleSheet,Text,TouchableHighlight,View ,Header } from "react-native"; class App extends Component { state = { modalVisible: false }; setModalVisible = (visible) => { this.setState({ modalVisible: visible }); } render() { const { modalVisible } = this.state; return ( <View style={styles.view}> <Text style={styles.header}>React Native Modal Popup Example itwebtu