File tree 2 files changed +36
-14
lines changed
2 files changed +36
-14
lines changed Original file line number Diff line number Diff line change @@ -198,20 +198,31 @@ export interface WithFormProps<
198
198
> {
199
199
// Optional, but adds props to the `render` function outside of `form`
200
200
props ?: TRenderProps
201
- render : (
201
+ render : <
202
+ TFFormData extends TFormData ,
203
+ TFOnMount extends undefined | FormValidateOrFn < TFFormData > ,
204
+ TFOnChange extends undefined | FormValidateOrFn < TFFormData > ,
205
+ TFOnChangeAsync extends undefined | FormAsyncValidateOrFn < TFFormData > ,
206
+ TFOnBlur extends undefined | FormValidateOrFn < TFFormData > ,
207
+ TFOnBlurAsync extends undefined | FormAsyncValidateOrFn < TFFormData > ,
208
+ TFOnSubmit extends undefined | FormValidateOrFn < TFFormData > ,
209
+ TFOnSubmitAsync extends undefined | FormAsyncValidateOrFn < TFFormData > ,
210
+ TFOnServer extends undefined | FormAsyncValidateOrFn < TFFormData > ,
211
+ TFSubmitMeta ,
212
+ > (
202
213
props : PropsWithChildren <
203
214
NoInfer < TRenderProps > & {
204
215
form : AppFieldExtendedReactFormApi <
205
- TFormData ,
206
- TOnMount ,
207
- TOnChange ,
208
- TOnChangeAsync ,
209
- TOnBlur ,
210
- TOnBlurAsync ,
211
- TOnSubmit ,
212
- TOnSubmitAsync ,
213
- TOnServer ,
214
- TSubmitMeta ,
216
+ TFFormData ,
217
+ TFOnMount ,
218
+ TFOnChange ,
219
+ TFOnChangeAsync ,
220
+ TFOnBlur ,
221
+ TFOnBlurAsync ,
222
+ TFOnSubmit ,
223
+ TFOnSubmitAsync ,
224
+ TFOnServer ,
225
+ TFSubmitMeta ,
215
226
TFieldComponents ,
216
227
TFormComponents
217
228
>
Original file line number Diff line number Diff line change @@ -235,9 +235,6 @@ describe('createFormHook', () => {
235
235
const incorrectFormOpts = formOptions ( {
236
236
defaultValues : {
237
237
firstName : 'FirstName' ,
238
- lastName : 'LastName' ,
239
- firstNameWrong : 'FirstName' ,
240
- lastNameWrong : 'LastName' ,
241
238
} ,
242
239
} )
243
240
@@ -247,5 +244,19 @@ describe('createFormHook', () => {
247
244
// @ts -expect-error Incorrect form opts
248
245
< WithFormComponent form = { incorrectAppForm } prop1 = "test" prop2 = { 10 } />
249
246
)
247
+
248
+ const extendingFormOpts = formOptions ( {
249
+ defaultValues : {
250
+ firstName : 'FirstName' ,
251
+ lastName : 'LastName' ,
252
+ country : 'Country' ,
253
+ } ,
254
+ } )
255
+
256
+ const extendingAppForm = useAppForm ( extendingFormOpts )
257
+
258
+ const ExtendingFormOptsComponent = (
259
+ < WithFormComponent form = { extendingAppForm } prop1 = "test" prop2 = { 10 } />
260
+ )
250
261
} )
251
262
} )
You can’t perform that action at this time.
0 commit comments