ArrayFrameProps
The props of the array frame structure slot.
The props a registered structure.arrayFrame component receives: the array field, a renderer
for each item, the labels of its controls and the operations that change the array. Props the
array entry passes under props come on top.
Type parameters
| Name | Description |
|---|---|
TItem | The type of one item of the array. |
TExtra | The props a frame hands to an item's widget through renderItem; none by default. |
Example
const ArrayFrame = <TItem,>({ keys, renderItem, add, remove, addLabel, removeLabels }: ArrayFrameProps<TItem>) => (
<ul>
{keys.map((key, index) => (
<li key={key}>
{renderItem(index)}
<button type="button" onClick={() => remove(index)}>{removeLabels[index]}</button>
</li>
))}
<button type="button" onClick={add}>{addLabel}</button>
</ul>
)Members
Prop
Type