import React, { PropsWithChildren } from 'react'; import { Platform, TouchableHighlight, TouchableNativeFeedback, View } from 'react-native'; import { useSharedProps } from './context/SharedPropsProvider'; import { GenericPressableProps } from './shared-types'; export default function GenericPressable({ style, children, borderless = false, ...otherProps }: PropsWithChildren) { const { pressableHightlightColor, GenericPressable: UserProvidedPressable } = useSharedProps(); if (UserProvidedPressable) { return ( {children} ); } if (Platform.OS === 'android') { // TouchableNativeFeedback does not support a // style prop. So we must wrap it inside a View. return ( {children} ); } return ( {children} ); }