mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 11:20:27 -06:00
Grafana/ui: Expose trigger method from useForm
to children (#73831)
Form: Expose trigger method from useForm to children
This commit is contained in:
parent
485f07cb7d
commit
6dea273044
@ -46,7 +46,7 @@ export function Form<T extends FieldValues>({
|
||||
onSubmit={handleSubmit(onSubmit)}
|
||||
{...htmlProps}
|
||||
>
|
||||
{children({ errors: formState.errors, formState, ...rest })}
|
||||
{children({ errors: formState.errors, formState, trigger, ...rest })}
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { UseFormReturn, FieldValues, FieldErrors, FieldArrayMethodProps } from 'react-hook-form';
|
||||
export type { SubmitHandler as FormsOnSubmit, FieldErrors as FormFieldErrors } from 'react-hook-form';
|
||||
|
||||
export type FormAPI<T extends FieldValues> = Omit<UseFormReturn<T>, 'trigger' | 'handleSubmit'> & {
|
||||
export type FormAPI<T extends FieldValues> = Omit<UseFormReturn<T>, 'handleSubmit'> & {
|
||||
errors: FieldErrors<T>;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user