UNPKG

@fruits-chain/react-native-xiaoshu

Version:
19 lines (16 loc) • 592 B
import { Field } from 'rc-field-form'; import React from 'react'; function hasValidName(name) { return !(name === undefined || name === null); } function FormItem(props) { const { children, ...restProps } = props; const hasName = hasValidName(restProps.name); const isRenderProps = typeof children === 'function'; return /*#__PURE__*/React.createElement(Field, restProps, !hasName && (restProps.shouldUpdate || restProps.dependencies) && isRenderProps ? (_, __, context) => children(context) : children); } export default FormItem; //# sourceMappingURL=form-item.js.map