diff --git a/packages/remix-forms/src/Form.tsx b/packages/remix-forms/src/Form.tsx index f332c83..446c221 100644 --- a/packages/remix-forms/src/Form.tsx +++ b/packages/remix-forms/src/Form.tsx @@ -86,6 +86,7 @@ type OnTransition = ( type FormProps = { component?: React.ForwardRefExoticComponent + formRef?: React.Ref fetcher?: Fetcher & { Form: ReturnType submit: ReturnType @@ -159,6 +160,7 @@ const fieldTypes: Record = { function Form({ component = RemixForm, + formRef, fetcher, mode = 'onSubmit', renderField = defaultRenderField, @@ -345,7 +347,7 @@ function Form({ }) return ( - + {beforeChildren} {mapChildren(children, (child) => { if (!React.isValidElement(child)) return child @@ -408,7 +410,7 @@ function Form({ } return ( - + {beforeChildren} {fields.map((field) => renderField({ Field, ...field }))} {globalErrors?.length && (