Post
related, i remember learning about the "as" from rebass around 2017 or 2018 but I see now that semantic ui had the initial version in 2016 random trivia: they called it "augmentation", before "composition" was cool, they later renamed it 😅 github.com/Semantic-Org...
Yeah, Semantic UI was the first component library I saw that used this prop as a core API for all its components. I created ReAs (React As) as an experiment around this (github.com/diegohaz/reas). This project eventually became Ariakit.
I added support for TypeScript and arrays, and then I renamed the prop to `use`. This was before React hooks. This work now lives in a separate repo for posterity: github.com/diegohaz/reuse
However, the as/use props had several problems. I talk about some of them here: youtu.be/_kyv3tnQKfg?...
Radix introduced a better API called `asChild`. People were requesting something similar in Ariakit. The discussion eventually led to this alternative `render` prop version.
Whether `render` is better than `asChild` ultimately comes down to personal preference. But @dio.la listed a few reasons I agree with that make `render` better: x.com/daniguardio_...
1 repost6 likes