-
I've dug into the code, and realized that the Is there a way to leverage this function to create components outside Ariakit that also support Ariakit's composition pattern? Bonus question: what's the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, you can use the function MyComponent(props) {
return <Role.div render={props.render} />;
}
|
Beta Was this translation helpful? Give feedback.
Yes, you can use the
Role
component:wrapElement
is a lower-level prop used by internal hooks to wrap the underlying element with other components like providers and React portal. You likely will never need it unless you're building custom component hooks likeuseDialog
,usePopover
, etc. Since those hooks don't return the JSX elements, but just the props to be passed to other elements, they use this customwrapElement
prop that will be later consumed by Ariakit's owncreateElement
orRole
.