Skip to content

withArrayItemId

withArrayItemId<T>(props): T

Defined in: packages/core/src/fields/array/utils.ts:65

Assigns a fresh id to one object-shaped array item that doesn’t already carry a (string) one. Shared by the server write path (assignArrayItemIds, below) and FormArray’s own handleAdd/ handleDuplicate (Step 15), so both sides generate ids identically — mirroring how cloneBlockWithFreshIds is the one place block ids get (re)assigned.

T

T

The item value. Returned unchanged for a non-object-shaped itemField — scalars have no id slot.

AdminField

The array’s own field.items definition.

T

item unchanged (scalar item), or a shallow copy with id set to its existing string id or a fresh nanoid().