• A utility function to render custom fields in a form, converting from definitions to actual form elements that can be placed inside of a

    element with react-hook-form.

    Custom form values will be placed under an object in the key provided in the customFieldsKey parameter.

    Type Parameters

    • TFormValues

    • TCustomFieldsKey extends string | number | symbol

    Parameters

    • customFields: undefined | FormCustomFieldDefinition<TFormValues, TCustomFieldsKey, string>[]

      The list of custom fields to render

    • customFieldsKey: TCustomFieldsKey

      The key in the form data where the custom fields should be placed

    • control: Control<TFormValues, any, TFormValues>

      The react-hook-form control object

    • Optional options: {
          cols?: 1 | 2 | "raw";
      }

      Additional options for rendering the custom fields

      • Optional cols?: 1 | 2 | "raw"

        The number of columns to place the custom fields in. Defaults to 'raw', which will render the custom fields without any wrapping elements.

    Returns React.ReactNode

    The rendered custom fields as a JSX element

Generated using TypeDoc