ReactNativeでボタンを表示する
ReactNativeでボタンを表示するサンプルです。
ボタンを押すとアラームが表示されます。
react-native: 0.56.0

index.js
import React, {Component} from 'react';
import {AppRegistry} from 'react-native';
import {
StyleSheet,
Button,
View,
Alert
} from 'react-native';
import {name as appName} from './app.json';
export class App extends Component {
render() {
return (
<View style={styles.container}>
<Button
color="red"
title={'Press Me'}
onPress={()=>Alert.alert('Hello')}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
AppRegistry.registerComponent(appName, () => App);
