-
Notifications
You must be signed in to change notification settings - Fork 534
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
Allow custom children
in ActionItem
#1196
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/primer/primer-components/CvhfL166KaFEGLfBxapmui6xYh6y |
🦋 Changeset detectedLatest commit: 0468584 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
a061412
to
f6ea5ff
Compare
f6ea5ff
to
1f63ed7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty straight forward - non blocking but maybe we could update the docs to at least list the new option to use children?
@VanAnderson I couldn't find any docs that explicitly define |
Co-authored-by: Clay Miller <clay@smockle.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 😎 Nice work on this!
Co-authored-by: Trevor Gau <trevorsg@gmail.com>
Some use cases for
ActionList
have revealed that the built-in rendering is not always providing enough flexibility, such as if you want to render the text inside a<Label>
. Although we can override rendering withrenderItem
, this fully replaces the entire item and removes helpful tools likeonAction
and theselected
checkmark. Additionally, the requirement oftext
onItemProps
forces consumers to convert existing data structures into a secondary data structure in order to providetext
. This change makes all fields optional (which opens it up for use by any item interface), and adds achildren
prop that will render a customReactNode
before thetext
section of the item.Screenshots
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.