import * as React from 'react'; import { TouchableWithoutFeedback, TouchableWithoutFeedbackProps, View, } from 'react-native'; import { UseFormField, useFormField } from '../hooks/useFormField'; export type FormFieldProps = React.PropsWithChildren< TouchableWithoutFeedbackProps & Omit< UseFormField, 'hasFocusCallback' | 'nextFormFieldRef' | 'nextFieldId' | 'editable' > & { wrapInsideAccessibleView?: boolean; } >; const FormFieldBase = ({ children, wrapInsideAccessibleView = true, ...props }: FormFieldProps) => { const viewRef = React.useRef | null>(null); // @ts-ignore const formProps = useFormField({ hasFocusCallback: false, ref: viewRef, ...props, }); return wrapInsideAccessibleView ? ( {children} ) : ( <>{children} ); }; export const FormField = React.memo(FormFieldBase);