Skip to content

resolveComponent ​

Overview ​

Resolve a configured component reference to a mountable component, the way every form and filter field does. A function wraps a component reference (to keep it out of reactive state) and is called for it; a string names an entry in lookup; anything else truthy is the component itself. Throws when nothing resolves, naming the field and its app and model: an absent reference, a name missing from lookup, or a function that returns no component.

Signature ​

resolveComponent(candidate, lookup, context)

Parameters ​

NameTypeRequiredDescription
candidatestring | Component | () => ComponentyesThe override or mapping value to resolve.
lookupobjectyesThe registry a string name is looked up in (availableFields or availableWidgets).
contextobjectyesWhat is being resolved, for the error message.

context Properties ​

NameTypeRequiredDefaultDescription
appstringno
fieldNamestring
kind"field" | "widget"
modelstringno

Returns ​

Component

The resolved component.

Source ​

client/lib/utils/buildForm.js:85