Skip to content

resolveColumnComponent ​

Overview ​

Resolve the adapter component for a single column, highest precedence first:

  1. propComponents[name] - the columnComponents prop on <ViewList>.
  2. configComponents[name] - modelConfig.config.columnComponents.
  3. type default from columnMappings.
  4. ColumnText fallback, for a type with no mapping entry.

The prop entry is picked before the config entry is considered, as in the form override chain. An override that names no component throws, so a misconfigured column is reported instead of rendering a default.

The consumer #field(<col>) slot (highest precedence overall) is handled in the ViewList template, not here.

Signature ​

resolveColumnComponent(field, propComponents, configComponents)

Parameters ​

NameTypeRequiredDescription
fieldFieldInfoyesThe column's field descriptor (carries name, typeSerializer, typeModel).
propComponentsobjectnoInline component overrides by field name.
configComponentsobjectnoModel-config component overrides by field name.

Returns ​

Component

The resolved adapter component.

Throws ​

  • When the picked override, or the type mapping's column, names no component.

Source ​

client/lib/utils/resolveColumnComponents.js:70