import React, { memo } from 'react'; import { TouchableWithoutFeedback, View } from 'react-native'; import type { FlexItemProps } from './interface'; const FlexItem: React.FC = (props) => { const { style, children, flex = 1, ...restProps } = props; const flexItemStyle = { flex, }; const inner = ( {children} ); const shouldWrapInTouchableComponent = restProps.onPress || restProps.onLongPress || restProps.onPressIn || restProps.onPressOut; if (shouldWrapInTouchableComponent) { return ( {inner} ); } return inner; }; export default memo(FlexItem);