Repeated Bricks

A brick used as a repeater item is just a normal brick, but it must spread ...rest props on its root element in order to be correctly focusable in the Admin interface.

A repeated brick receives also the index on the props, so that it may conditionally render based on its position in the items array.

Example

const Badge: types.Brick<BadgeProps> = ({
index,
...rest
}) => {
return (
<div {...rest}>
I am the item #{index}.
...
</div>
)
}
Badge.schema = {
...
}
export default Badge