Button no React Native

Exemplo simples de como criar um buttons no react native com Alert

/**
 * Sample React Native App
 * Button com Alert 
 */

import React, { Component } from ‘react’;
import {
 AppRegistry,
 StyleSheet,
 Text,
 View,
 Alert,
 Button
} from ‘react-native’;

const onButtonPress = () => {
 Alert.alert(‘Button foi pressionado!’);
 };

class AppTeste extends Component {

render() {
 return (
 <View style={styles.container}>
 <Button 
 onPress={onButtonPress}
 title=”AperteME”
 color=”#841584"
 accessibilityLabel=”Learn more about this purple button”
 />
 </View>
 );
 }
}

const styles = StyleSheet.create({
 container: {
 flex: 1,
 justifyContent: ‘center’,
 alignItems: ‘center’,
 backgroundColor: ‘#F5FCFF’,
 },

});

AppRegistry.registerComponent(‘AppTeste’, () => AppTeste);

Tela com o button
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.