From fa64d7ece40fea4c5279580730e427a6fe6f3799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 3 Dec 2020 17:35:34 +0100 Subject: [PATCH] Alert: Fix forwardRef warning (#29577) --- packages/grafana-ui/src/components/Alert/Alert.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/grafana-ui/src/components/Alert/Alert.tsx b/packages/grafana-ui/src/components/Alert/Alert.tsx index b009b01d5fc..451197091d9 100644 --- a/packages/grafana-ui/src/components/Alert/Alert.tsx +++ b/packages/grafana-ui/src/components/Alert/Alert.tsx @@ -9,7 +9,7 @@ import { getColorsFromSeverity } from '../../utils/colors'; export type AlertVariant = 'success' | 'warning' | 'error' | 'info'; -export interface Props extends HTMLAttributes { +export interface Props extends HTMLAttributes { title: string; /** On click handler for alert button, mostly used for dismissing the alert */ onRemove?: (event: React.MouseEvent) => void; @@ -39,13 +39,13 @@ function getIconFromSeverity(severity: AlertVariant): string { } } -export const Alert: FC = React.forwardRef( - ({ title, buttonText, onButtonClick, onRemove, children, buttonContent, severity = 'error', ...restProps }) => { +export const Alert: FC = React.forwardRef( + ({ title, buttonText, onButtonClick, onRemove, children, buttonContent, severity = 'error', ...restProps }, ref) => { const theme = useTheme(); const styles = getStyles(theme, severity, !!buttonContent); return ( -
+