useSlotNameGrouper
Overview
Organizes slots by prefix (e.g., "field", "widget") for a specific field name.
Helps components like FieldRenderer and FormModel collect related slots into functional groups, e.g., all field(myField)... slots.
Returns:
- grouped slots by prefix
- unmatched remaining slots
- a helper to check if a prefix has slots
Signature
useSlotNameGrouper(groupPrefixes, fieldName, slots)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| groupPrefixes | string[] | Ref | yes | The groupPrefixes of the slot name. |
| fieldName | string | Ref | yes | The field name to check for. |
| slots | object | yes | The slot names to check for. |
Returns
object
Source
client/lib/use/useSlotNameGrouper.js:35