Dropdown: Stop Dropdown accepting a function as children (#65467)

remove dropdown accepting function children
This commit is contained in:
Ashley Harrison
2023-04-04 14:40:44 +01:00
committed by GitHub
parent fcabaac037
commit 6f7363af3a
2 changed files with 10 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ import { TooltipPlacement } from '../Tooltip/types';
export interface Props {
overlay: React.ReactElement | (() => React.ReactElement);
placement?: TooltipPlacement;
children: React.ReactElement | ((isOpen: boolean) => React.ReactElement);
children: React.ReactElement;
/** Amount in pixels to nudge the dropdown vertically and horizontally, respectively. */
offset?: [number, number];
onVisibleChange?: (state: boolean) => void;
@@ -51,7 +51,7 @@ export const Dropdown = React.memo(({ children, overlay, placement, offset, onVi
return (
<>
{React.cloneElement(typeof children === 'function' ? children(visible) : children, {
{React.cloneElement(children, {
ref: setTriggerRef,
})}
{visible && (