Type alias FieldRenderFunction<TFieldValues>

FieldRenderFunction<TFieldValues>: ((data) => React.ReactNode)

Type representing the function to render a form field.

Type Parameters

  • TFieldValues extends FieldValues

    The type of field values.

Type declaration

    • (data): React.ReactNode
    • Parameters

      • data: {
            formDisabled: boolean;
            formErrors: FieldErrors<TFieldValues>;
            formItem: IFieldSchema<TFieldValues>;
            formMethods: UseFormReturn<TFieldValues>;
            submitButtonLoading?: boolean;
        }
        • formDisabled: boolean

          Whether the form is disabled.

        • formErrors: FieldErrors<TFieldValues>

          The errors in the form state.

        • formItem: IFieldSchema<TFieldValues>

          The schema definition of the form field.

        • formMethods: UseFormReturn<TFieldValues>

          Methods from react-hook-form for managing the form state.

        • Optional submitButtonLoading?: boolean

          Whether the submit button is loading.

      Returns React.ReactNode