# replace

Replaces an item in a field array at the specified index with a new item.

```ts
replace<TSchema, TFieldArrayPath>(form, config);
```

## Generics

- `TSchema` <Property {...properties.TSchema} />
- `TFieldArrayPath` <Property {...properties.TFieldArrayPath} />

## Parameters

- `form` <Property {...properties.form} />
- `config` <Property {...properties.config} />

### Explanation

The `form` parameter is the form store containing the field array. The `config` parameter specifies the path to the field array, the index of the item to replace, and the new item values.

## Related

### Primitives

<ApiList
  items={[
    { text: 'createForm', href: '/solid/api/createForm/' },
    {
      text: 'useFieldArray',
      href: '/solid/api/useFieldArray/',
    },
  ]}
/>

### Methods

<ApiList
  items={[
    { text: 'insert', href: '../insert/' },
    { text: 'move', href: '../move/' },
    { text: 'remove', href: '../remove/' },
    { text: 'swap', href: '../swap/' },
  ]}
/>
