-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Could useComponentRenderer be exported as a util? #1370
Comments
@dpeek Could you share more about your use-case? I wonder if it may be similar as the use-case for the Slot utility While discussing that we did consider that a hook may be a better abstraction than However useComponentRenderer is highly tailored for our internal use, so if we do provide this as a hook it would be a simplified version of it |
There's now an open PR with a POC and a sandbox if anybody would like to try it out in the mean time: #1418 |
Wow, thanks for the speedy response, and apologies for not responding in kind! Yes, my use-case is exactly like the Slot utility in radix, and in fact I was porting some shadcn components and wondering what to do there. I ended up grabbing all the code needed for useComponentRenderer as an interim solution and that worked ok. I'll give the new hook a try and let you know if I run into any problems. Thanks again, excited about the future of the project! |
I'd like to support the same
render
prop approach to composition for consistency with those provided by base-ui.Could the
useComponentRenderer
utility be exported from@base-ui-components/react/utils
?Happy to create a PR if this sounds OK.
The text was updated successfully, but these errors were encountered: