mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dropdown: Stop Dropdown accepting a function as children (#65467)
remove dropdown accepting function children
This commit is contained in:
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user