* Generate a unique widget key for a definition. * This ensures each call to defineWidget creates a distinct widget type.
(name?: string)
| 234 | * This ensures each call to defineWidget creates a distinct widget type. |
| 235 | */ |
| 236 | function generateWidgetKey(name?: string): string { |
| 237 | const id = widgetKeyCounter++; |
| 238 | return name ? `${name}_${id}` : `Widget_${id}`; |
| 239 | } |
| 240 | |
| 241 | /** |
| 242 | * Props constraint: must have optional key property. |