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.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”T
The item value. Returned unchanged for a
non-object-shaped itemField — scalars have no id slot.
itemField
Section titled “itemField”The array’s own field.items definition.
Returns
Section titled “Returns”T
item unchanged (scalar item), or a shallow copy with id set
to its existing string id or a fresh nanoid().