Skip to content

FormBindingMethod

FormBindingMethod<T, Binding> = Binding extends new (form: Form<any>, config: infer Config) => object ? (...config: ConfigParameter<Config>) => Props : Binding extends new (fields: FormField[], config: infer Config) => object ? (fieldNames: FormField.Name<T>[], ...config: ConfigParameter<Config>) => Props : Binding extends new (field: FormField, config: infer Config) => object ? (fieldName: FormField.Name<T>, ...config: ConfigParameter<Config>) => Props : never

Defined in: binding.ts:141

Bind method derived from a binding class

  • A binding for the form takes the config only
  • A binding for multiple fields takes the field names and the config
  • A binding for a field takes the field name and the config
  • The config is optional when none of its keys is required
  • It returns the props of the binding

The type parameters of a generic binding class fall back to their constraints. Write the method for such a class by hand, as an override in FormBindingMethods.