From 41252321912e824e76071c741a0830f57ba141bd Mon Sep 17 00:00:00 2001 From: Van Anderson Date: Tue, 8 Jun 2021 13:29:38 -0500 Subject: [PATCH] renderAnchor should not return null --- src/ActionMenu.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ActionMenu.tsx b/src/ActionMenu.tsx index 48a1425caa1..5e735823833 100644 --- a/src/ActionMenu.tsx +++ b/src/ActionMenu.tsx @@ -14,10 +14,12 @@ interface ActionMenuPropsWithAnchor { * Will receive the `anchoredContent` prop as `children` prop. * Uses a `Button` by default. */ - renderAnchor?: >(props: T) => JSX.Element | null + renderAnchor?: >(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 } @@ -25,8 +27,7 @@ interface ActionMenuPropsWithAnchor { 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