Post

I didn't get any credit for the `as` prop back then, which is fair since I didn't invent it. I borrowed it from a library called Semantic UI. But I'd be sad if the same thing happened with the `render⁠=⁠{⁠<⁠Comp⁠ ⁠/⁠>⁠}⁠` API. I invested a lot of time in that.

not a brag, but I've been using an `element={<Comp/>}` prop in some of my stuff before I've seen _any_ library use it 🤭 although it didn't support an alternative function variant, and I actually wasn't too confident about it generally, until Ariakit and others validated it 😊

Yes, it's mentioned here: bsky.app/profile/haz.... Naming is important, though. And I believe the best aspect of this API is that it's optimized for change whenever you need it. High-level: <A> Mid-level: <A render={<B />}> Low-level: <A render={props => <B {...props} />}>

Haz@haz.dev

So, this `render={<Comp />}` API comes from the as prop, asChild, and the original render prop composition pattern, which I believe originates from React Router. Here's how I see it:

0 reposts2 likes

No replies yet.