Closed marbemac closed 1 year ago
Hi, i'm aware of the poor autocomplete performance in IDEs of the as
prop and don't like it too 😅. I've already looked at radix asChild
but I don't think it can be done the same way in solid. The react implementation reply on React.cloneElement
and things like child.type === Slottable
, but in solid there is on VDOM element to clone in order to merge the props like they does
Ah ok, fair enough yeah that makes sense. Thanks for the response!
With respect to changing the rendered element, I noticed that Kobalte is using the
as
pattern. Pros/cons to each, but have you considered theasChild
pattern. Radix ended up changing fromas
toasChild
to simplify typings, and improve autocomplete performance in IDEs (and maybe some other reasons, I don't remember TBH): https://www.radix-ui.com/docs/primitives/overview/styling#changing-the-rendered-elementBoth work! Just wanted to share the other pattern for consideration while Kobalte is still in the early malleable stages, in case you hadn't already seen it.
Eagerly looking forward to giving Kobalte a spin, whenever it's on NPM.