UNPKG

@fruits-chain/react-native-xiaoshu

Version:
31 lines (30 loc) • 818 B
"use strict"; import React, { memo } from 'react'; import { TouchableWithoutFeedback, View } from 'react-native'; import { jsx as _jsx } from "react/jsx-runtime"; const FlexItem = props => { const { style, children, flex = 1, ...restProps } = props; const flexItemStyle = { flex }; const inner = /*#__PURE__*/_jsx(View, { style: [flexItemStyle, style], ...restProps, children: children }); const shouldWrapInTouchableComponent = restProps.onPress || restProps.onLongPress || restProps.onPressIn || restProps.onPressOut; if (shouldWrapInTouchableComponent) { return /*#__PURE__*/_jsx(TouchableWithoutFeedback, { ...restProps, children: inner }); } return inner; }; export default /*#__PURE__*/memo(FlexItem); //# sourceMappingURL=flex-item.js.map