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
| Name | Type | Required | Description |
|---|---|---|---|
| candidate | string | Component | () => Component | yes | The override or mapping value to resolve. |
| lookup | object | yes | The registry a string name is looked up in (availableFields or availableWidgets). |
| context | object | yes | What is being resolved, for the error message. |
context Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| app | string | no | ||
| fieldName | string | |||
| kind | "field" | "widget" | |||
| model | string | no |
Returns
Component
The resolved component.
Source
client/lib/utils/buildForm.js:85