Replies: 1 comment 1 reply
-
|
Ah, seems like GitHub didn't embed the function's code like I expected. Here's the permalink to the code I'm talking about: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to open up by saying that I'm just coming into this library for the first time, and that I'm still finding my footing in developing React applications, but I'm ecstatic at the idea of helping create a more accessible web using react-aria(-components) :)
I did want to bring up something I noticed as I've dug into the examples for this library -- this
composeRenderProps()function that seems to be pervasive throughout the entire codebase (e.g., in Tabs.tsx, Button.tsx, etc.) I've seen and understand the examples of using it for things like applyingtailwind-variantsstyles, though I've had trouble understanding some of its other instances in the codebase, and I was still a little bit lost on why this pattern is used and in so many places at that. I have to believe there is good reason for using it, but I've just had trouble understanding it as someone just coming into this library and its design patterns.I did find a PR #5596 from 2023 where the function was first merged into the repo by @devongovett, which mentions that this helper function "will help combine render props passed in from outside a component with built-in ones", and that they'd "need to find a place to document this." As far as I can tell, its documentation has been limited to the JSDoc comment above the function's definition -- it's only referenced in issue #5767 and in no other discussions, as far as I can tell. Would it be possible to add more details on why this pattern is used in the RA documentation (and how/where developers using RA can take advantage of it)?
I'm hoping that this discussion at least shows up on Google for anyone that was wondering the same thing I was.
Beta Was this translation helpful? Give feedback.
All reactions