import React from 'react' ; import { TouchableOpacity , Text , StyleSheet } from 'react-native' ; interface MyButtonProps { onPress : ( ) => void ; text : string ; } export const MyButton = ( { onPress , text } ) => { return ( < TouchableOpacity style = { styles . container } onPress = { onPress } > < Text style = { styles . text } > { text } < /Text> < /TouchableOpacity>); } ; const styles = StyleSheet . create ( { container : { paddingHorizontal : 16 , paddingVertical : 8 , backgroundColor : 'violet' , } , text : { color : 'black' } , } ) ;