diff --git a/packages/grafana-ui/src/components/Drawer/Drawer.tsx b/packages/grafana-ui/src/components/Drawer/Drawer.tsx index 9fb7d53ea29..9ef23bc23d3 100644 --- a/packages/grafana-ui/src/components/Drawer/Drawer.tsx +++ b/packages/grafana-ui/src/components/Drawer/Drawer.tsx @@ -9,7 +9,7 @@ import { stylesFactory, useTheme } from '../../themes'; export interface Props { children: ReactNode; /** Title shown at the top of the drawer */ - title?: (() => JSX.Element) | string; + title?: JSX.Element | string; /** Should the Drawer be closable by clicking on the mask */ closeOnMaskClick?: boolean; /** Render the drawer inside a container on the page */ @@ -98,7 +98,7 @@ export const Drawer: FC = ({ )} - {typeof title === 'function' && title()} + {typeof title !== 'string' && title}
{!scrollableContent ? children : {children}}
diff --git a/packages/grafana-ui/src/components/Forms/Form.story.tsx b/packages/grafana-ui/src/components/Forms/Form.story.tsx index ded4478e682..60fdd214e7e 100644 --- a/packages/grafana-ui/src/components/Forms/Form.story.tsx +++ b/packages/grafana-ui/src/components/Forms/Form.story.tsx @@ -91,7 +91,7 @@ const renderForm = (defaultValues?: Partial) => ( -