Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 971 Bytes

arrayFieldOf.md

File metadata and controls

42 lines (26 loc) · 971 Bytes

@lynxts/coreDocs


@lynxts/core / arrayFieldOf

Function: arrayFieldOf()

arrayFieldOf<T>(): ArrayFieldOf<T>

Utility function which helps you create an ArrayField component of an specific struct type. Once you have this, the only type parameter left is the Path<T> of the property which is an array.

Type Parameters

T extends Struct

Returns

ArrayFieldOf<T>

an ArrayField of the specified struct type

Example

interface User {
  name: string;
  roles: Role[];
}

const ArrayField = arrayFieldOf<User>();

<ArrayField name="roles">
  ...
</ArrayField>

Defined in

components/ArrayField.component.tsx:101