Post

I would argue that React already has slots with a different syntax via component props. It's not a perfectly ideal syntax, but, arguably, it's better than the string-matching chaos of web components. After all, I can write <ProfileCardRaw name="BellCube" description={<p>A very cool person!</p>} />

Imo <ProfileCardRaw description={<p>A very cool person!</p>}/> (especially if there are more props/render props!) is a lot harder to read/parse than <ProfileCardRaw> <p slot="description">A very cool person!</p> </ProfileCardRaw> This is an opinion, other peoples opinions may differ.

perhaps, I think that's only really true if you have one or few props. when you have many, it's nicer to more quickly see slots imo. but for slots, I'd do this syntax:

0 reposts0 likes

(counter to an earlier point I made) I think the platform kinda messed up on the syntax of slots, and the above is way better than: <arbitrary-element slot="whatever"> additionally, many slots don't even need or want a host element (p in your example).