Want to create simple alerts in a react native application? Use the below react native code in your App.js file to create simple alerts in a react native application.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import * as React from 'react'; import { Text, View, StyleSheet, Button } from 'react-native'; export default function App () { return ( <View style={styles.container}> <Text> SIMPLE ALERTS </Text> <Button onPress={() => { alert('I LOVE JESUS!!!'); }} title="CLICK" /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center', }, }); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.