diff --git a/packages/react-form/src/createFormHook.tsx b/packages/react-form/src/createFormHook.tsx index 6a4140768..fc5593dec 100644 --- a/packages/react-form/src/createFormHook.tsx +++ b/packages/react-form/src/createFormHook.tsx @@ -198,20 +198,31 @@ export interface WithFormProps< > { // Optional, but adds props to the `render` function outside of `form` props?: TRenderProps - render: ( + render: < + TFFormData extends TFormData, + TFOnMount extends undefined | FormValidateOrFn, + TFOnChange extends undefined | FormValidateOrFn, + TFOnChangeAsync extends undefined | FormAsyncValidateOrFn, + TFOnBlur extends undefined | FormValidateOrFn, + TFOnBlurAsync extends undefined | FormAsyncValidateOrFn, + TFOnSubmit extends undefined | FormValidateOrFn, + TFOnSubmitAsync extends undefined | FormAsyncValidateOrFn, + TFOnServer extends undefined | FormAsyncValidateOrFn, + TFSubmitMeta, + >( props: PropsWithChildren< NoInfer & { form: AppFieldExtendedReactFormApi< - TFormData, - TOnMount, - TOnChange, - TOnChangeAsync, - TOnBlur, - TOnBlurAsync, - TOnSubmit, - TOnSubmitAsync, - TOnServer, - TSubmitMeta, + TFFormData, + TFOnMount, + TFOnChange, + TFOnChangeAsync, + TFOnBlur, + TFOnBlurAsync, + TFOnSubmit, + TFOnSubmitAsync, + TFOnServer, + TFSubmitMeta, TFieldComponents, TFormComponents > diff --git a/packages/react-form/tests/createFormHook.test-d.tsx b/packages/react-form/tests/createFormHook.test-d.tsx index d253a0049..b202ac701 100644 --- a/packages/react-form/tests/createFormHook.test-d.tsx +++ b/packages/react-form/tests/createFormHook.test-d.tsx @@ -235,9 +235,6 @@ describe('createFormHook', () => { const incorrectFormOpts = formOptions({ defaultValues: { firstName: 'FirstName', - lastName: 'LastName', - firstNameWrong: 'FirstName', - lastNameWrong: 'LastName', }, }) @@ -247,5 +244,19 @@ describe('createFormHook', () => { // @ts-expect-error Incorrect form opts ) + + const extendingFormOpts = formOptions({ + defaultValues: { + firstName: 'FirstName', + lastName: 'LastName', + country: 'Country', + }, + }) + + const extendingAppForm = useAppForm(extendingFormOpts) + + const ExtendingFormOptsComponent = ( + + ) }) })