asChild without exactly one element child
Why it matters
Slot clones a single child; text, fragments or several children throw React.Children.only.
Fix
Wrap the children in one element.
Credit
From Radix UI
asChild requires exactly one child element that receives the merged props.
References
- Composition — Radix PrimitivesRadix UI