import React from 'react'; import { StyleProp, ViewStyle, Pressable, Platform } from 'react-native'; type Props = { onPress(): void; style?: StyleProp; children?: React.ReactElement; hitSlop?: number; accessibilityLabel?: string; }; const ButtonIOS: React.FC = ({ onPress, style, accessibilityLabel, hitSlop, children, }) => { return ( [style, pressed && { opacity: 0.5 }]} > {children} ); }; const ButtonAndroid: React.FC = ({ onPress, style, accessibilityLabel, hitSlop, children, }) => { return ( {children} ); }; export default Platform.OS === 'ios' ? ButtonIOS : ButtonAndroid;