Index
Alert
//This is an example code to understand Alert//
import React, { Component } from 'react';
//import react in our code.
import { Alert, Button, View, StyleSheet } from 'react-native';
import React, { Component } from 'react';
//import react in our code.
import { Alert, Button, View, StyleSheet } from 'react-native';
Alert.alert(
//title
'Hello',
//body
'I am three option alert. Do you want to cancel me ?',
[
{text: 'May be', onPress: () => console.log('May be Pressed')},
{text: 'Yes', onPress: () => console.log('Yes Pressed')},
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
{ cancelable: true }
);
//title
'Hello',
//body
'I am three option alert. Do you want to cancel me ?',
[
{text: 'May be', onPress: () => console.log('May be Pressed')},
{text: 'Yes', onPress: () => console.log('Yes Pressed')},
{text: 'OK', onPress: () => console.log('OK Pressed')},
],
{ cancelable: true }
);