Skip to content

Commit

Permalink
Support ReactNode in ActionMenu.Overlay (#2168) (#2188)
Browse files Browse the repository at this point in the history
* Supporting ReactNode type for ActionMenu children

* Fixing spacing

* Updating ActionMenu.Overlay props docs

* Adding changeset

Co-authored-by: Joshua Rush <jdrush89@gmail.com>
Co-authored-by: Cole Bemis <colebemis@github.com>
  • Loading branch information
3 people committed Aug 25, 2022
1 parent 3a29eb3 commit 8fc2e42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shiny-hairs-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

Support React.ReactNode as child type in ActionMenu.Overlay
2 changes: 1 addition & 1 deletion docs/content/ActionMenu.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ render(
### ActionMenu.Overlay

<PropsTable>
<PropsTableRow name="children" required type="React.ReactElement | React.ReactElement[]" />
<PropsTableRow name="children" required type="React.ReactNode" />
<PropsTableRow name="align" type="start | center | end" defaultValue="start" />
<PropsTablePassthroughPropsRow
elementName="Overlay"
Expand Down
2 changes: 1 addition & 1 deletion src/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ type MenuOverlayProps = Partial<OverlayProps> &
/**
* Recommended: `ActionList`
*/
children: React.ReactElement[] | React.ReactElement
children: React.ReactNode
}
const Overlay: React.FC<React.PropsWithChildren<MenuOverlayProps>> = ({children, align = 'start', ...overlayProps}) => {
// we typecast anchorRef as required instead of optional
Expand Down

0 comments on commit 8fc2e42

Please sign in to comment.