---
url: "https://vueda.dev/v3/reference/api/js/utils/buildForm/functions/resolveComponent.md"
title: "resolveComponent"
---

# 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 |
| --- | --- | --- | --- |
| <span id="param-candidate">candidate</span> | `string \| Component \| () => Component` | yes | The override or mapping value to resolve. |
| <span id="param-lookup">lookup</span> | `object` | yes | The registry a string name is looked up in (`availableFields` or `availableWidgets`). |
| <span id="param-context">context</span> | `object` | yes | What is being resolved, for the error message. |

#### context Properties

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| <span id="param-context-app">app</span> | `string` | no |  |  |
| <span id="param-context-fieldName">fieldName</span> | `string` |  |  |  |
| <span id="param-context-kind">kind</span> | `"field" \| "widget"` |  |  |  |
| <span id="param-context-model">model</span> | `string` | no |  |  |

### Returns

`Component`

The resolved component.

## Source

`client/lib/utils/buildForm.js:85`
