Skip to content
Discussion options

You must be logged in to vote

Is forwardRef() a must with all Radix components if I want to create a my own styled Radix components?

I would say yes, but to be honest this is not really a Radix thing, but rather a React thing. If you want your leaf components to remain as compatible/composable as possible with any other React components, you need to ensure they behave like their lower level DOM counterpart. That means ensuring all props are passed in/merged, as well as forwarding ref as you have no idea when other components/abstractions will pass props or attach refs to it.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benoitgrelard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants