Skip to content

Commit

Permalink
renderAnchor should not return null
Browse files Browse the repository at this point in the history
  • Loading branch information
VanAnderson committed Jun 8, 2021
1 parent db0410d commit 4125232
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ActionMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ interface ActionMenuPropsWithAnchor {
* Will receive the `anchoredContent` prop as `children` prop.
* Uses a `Button` by default.
*/
renderAnchor?: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element | null
renderAnchor?: <T extends React.HTMLAttributes<HTMLElement>>(props: T) => JSX.Element

/**
* An override to the internal ref that will be spread on to the renderAnchor
* An override to the internal ref that will be spread on to the renderAnchor,
* when renderAnchor is defined, this prop will be spread on to the rendAnchor
* component that is passed in.
*/
anchorRef?: React.RefObject<HTMLElement>
}

interface ActionMenuPropsWithoutAnchor {
/**
* A custom function component used to render the anchor element.
* Will receive the `anchoredContent` prop as `children` prop.
* Uses a `Button` by default.
* When renderAnchor is null, an anchorRef is required.
*/
renderAnchor: null

Expand Down

0 comments on commit 4125232

Please sign in to comment.