File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/components/forms/Form Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @cube-dev/ui-kit ' : patch
3+ ---
4+
5+ Improve typings of ` onSubmit ` and ` onValuesChange ` callbacks in ` <Form /> ` component. Now they properly match with ` FormInstance ` and ` useForm ` .
Original file line number Diff line number Diff line change @@ -64,11 +64,11 @@ export interface CubeFormProps<T extends FieldTypes = FieldTypes>
6464 /** Form name */
6565 name ?: string ;
6666 /** Default field values */
67- defaultValues ?: { [ K in keyof T ] ?: T [ K ] } ;
67+ defaultValues ?: Partial < T > ;
6868 /** Trigger when any value of Field changed */
69- onValuesChange ?: ( data : CubeFormData < T > ) => void | Promise < void > ;
69+ onValuesChange ?: CubeFormInstance < T > [ 'onValuesChange' ] ;
7070 /** Trigger when form submit and success */
71- onSubmit ?: ( data : CubeFormData < T > ) => void | Promise < void > ;
71+ onSubmit ?: CubeFormInstance < T > [ 'onSubmit' ] ;
7272 /** Trigger when form submit and failed */
7373 onSubmitFailed ?: ( any ?) => void | Promise < any > ;
7474 /** Set form instance created by useForm */
You can’t perform that action at this time.
0 commit comments