react-native-embryo
Version:
- [x] Bugfree Xcode & Android setups for multiple build flavors - [x] [React Native Navigation](https://github.com/wix/react-native-navigation) - [x] [MobX](https://github.com/mobxjs/mobx) - [x] Friendly exception handling (no crash :dizzy_face:) - [x] Ce
29 lines (24 loc) • 606 B
JavaScript
// @flow
import React from 'react'
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native'
const Button = (props: { onPress: () => void, color?: string, title: string }) => (
<TouchableOpacity
accessibilityComponentType="button"
onPress={props.onPress}
>
<View>
<Text style={[styles.buttonText, { color: props.color }]}>{props.title}</Text>
</View>
</TouchableOpacity>
)
Button.defaultProps = {
color: '#007AFF',
}
const styles = StyleSheet.create({
buttonText: {
textAlign: 'center',
padding: 12,
fontSize: 18,
},
})
export default Button