diff --git a/packages/grafana-ui/src/components/Button/Button.tsx b/packages/grafana-ui/src/components/Button/Button.tsx index d8e6e54d3fa..19c9b704934 100644 --- a/packages/grafana-ui/src/components/Button/Button.tsx +++ b/packages/grafana-ui/src/components/Button/Button.tsx @@ -22,7 +22,7 @@ type BaseProps = { size?: ComponentSize; variant?: ButtonVariant; fill?: ButtonFill; - icon?: IconName | React.ReactElement; + icon?: IconName | React.ReactElement; className?: string; fullWidth?: boolean; type?: string; @@ -207,8 +207,13 @@ export const LinkButton = React.forwardRef( LinkButton.displayName = 'LinkButton'; +type IconElementProps = { + className?: string; + size?: IconSize; +}; + interface IconRendererProps { - icon?: IconName | React.ReactElement<{ className?: string; size?: IconSize }>; + icon?: IconName | React.ReactElement; size?: IconSize; className?: string; iconType?: IconType; diff --git a/packages/grafana-ui/src/components/DataLinks/DataLinkSuggestions.tsx b/packages/grafana-ui/src/components/DataLinks/DataLinkSuggestions.tsx index e812bbcd6a9..1e166018b97 100644 --- a/packages/grafana-ui/src/components/DataLinks/DataLinkSuggestions.tsx +++ b/packages/grafana-ui/src/components/DataLinks/DataLinkSuggestions.tsx @@ -103,7 +103,7 @@ DataLinkSuggestions.displayName = 'DataLinkSuggestions'; interface DataLinkSuggestionsListProps extends DataLinkSuggestionsProps { label: string; activeIndexOffset: number; - activeRef?: React.RefObject; + activeRef?: React.RefObject; } const DataLinkSuggestionsList = React.memo( diff --git a/packages/grafana-ui/src/components/RenderUserContentAsHTML/RenderUserContentAsHTML.tsx b/packages/grafana-ui/src/components/RenderUserContentAsHTML/RenderUserContentAsHTML.tsx index 456d5044dd3..c490823a2a3 100644 --- a/packages/grafana-ui/src/components/RenderUserContentAsHTML/RenderUserContentAsHTML.tsx +++ b/packages/grafana-ui/src/components/RenderUserContentAsHTML/RenderUserContentAsHTML.tsx @@ -1,11 +1,10 @@ -import { HTMLAttributes, PropsWithChildren, type JSX } from 'react'; -import * as React from 'react'; +import { createElement, type HTMLAttributes, type PropsWithChildren, type HTMLElementType, type JSX } from 'react'; import { textUtil } from '@grafana/data'; export interface RenderUserContentAsHTMLProps extends Omit, 'dangerouslySetInnerHTML'> { - component?: keyof React.ReactHTML; + component?: HTMLElementType; content: string; } @@ -19,7 +18,7 @@ export function RenderUserContentAsHTML({ content, ...rest }: PropsWithChildren>): JSX.Element { - return React.createElement(component || 'span', { + return createElement(component || 'span', { dangerouslySetInnerHTML: { __html: textUtil.sanitize(content) }, ...rest, }); diff --git a/packages/grafana-ui/src/components/Table/hooks.ts b/packages/grafana-ui/src/components/Table/hooks.ts index 4ede3fbc975..eee19a6532b 100644 --- a/packages/grafana-ui/src/components/Table/hooks.ts +++ b/packages/grafana-ui/src/components/Table/hooks.ts @@ -14,8 +14,8 @@ import { GrafanaTableState } from './types'; Select the scrollbar element from the VariableSizeList scope */ export function useFixScrollbarContainer( - variableSizeListScrollbarRef: React.RefObject, - tableDivRef: React.RefObject + variableSizeListScrollbarRef: React.RefObject, + tableDivRef: React.RefObject ) { useEffect(() => { if (variableSizeListScrollbarRef.current && tableDivRef.current) { diff --git a/public/app/features/alerting/unified/components/CollapseToggle.tsx b/public/app/features/alerting/unified/components/CollapseToggle.tsx index ee877952ef9..866ae482928 100644 --- a/public/app/features/alerting/unified/components/CollapseToggle.tsx +++ b/public/app/features/alerting/unified/components/CollapseToggle.tsx @@ -2,7 +2,7 @@ import { HTMLAttributes } from 'react'; import { Button, IconSize } from '@grafana/ui'; -interface Props extends HTMLAttributes { +interface Props extends Omit, 'onToggle'> { isCollapsed: boolean; onToggle: (isCollapsed: boolean) => void; // Todo: this should be made compulsory for a11y purposes diff --git a/public/app/features/explore/TraceView/components/TraceTimelineViewer/VirtualizedTraceView.tsx b/public/app/features/explore/TraceView/components/TraceTimelineViewer/VirtualizedTraceView.tsx index d53cdf4a94e..a048fad1298 100644 --- a/public/app/features/explore/TraceView/components/TraceTimelineViewer/VirtualizedTraceView.tsx +++ b/public/app/features/explore/TraceView/components/TraceTimelineViewer/VirtualizedTraceView.tsx @@ -102,7 +102,7 @@ type TVirtualizedTraceViewOwnProps = { focusedSpanIdForSearch: string; showSpanFilterMatchesOnly: boolean; createFocusSpanLink: (traceId: string, spanId: string) => LinkModel; - topOfViewRef?: RefObject; + topOfViewRef?: RefObject; datasourceType: string; datasourceUid: string; headerHeight: number; diff --git a/public/app/features/explore/TraceView/components/TraceTimelineViewer/index.tsx b/public/app/features/explore/TraceView/components/TraceTimelineViewer/index.tsx index 08e931c768e..69877b0b74a 100644 --- a/public/app/features/explore/TraceView/components/TraceTimelineViewer/index.tsx +++ b/public/app/features/explore/TraceView/components/TraceTimelineViewer/index.tsx @@ -104,7 +104,7 @@ export type TProps = { focusedSpanIdForSearch: string; showSpanFilterMatchesOnly: boolean; createFocusSpanLink: (traceId: string, spanId: string) => LinkModel; - topOfViewRef?: RefObject; + topOfViewRef?: RefObject; headerHeight: number; criticalPath: CriticalPathSection[]; traceFlameGraphs: TraceFlameGraphs; diff --git a/public/app/features/plugins/extensions/ExtensionErrorBoundary.tsx b/public/app/features/plugins/extensions/ExtensionErrorBoundary.tsx index 5d85e16eee1..99886edf488 100644 --- a/public/app/features/plugins/extensions/ExtensionErrorBoundary.tsx +++ b/public/app/features/plugins/extensions/ExtensionErrorBoundary.tsx @@ -25,7 +25,6 @@ export const ExtensionErrorBoundary = ({ log.error(`Extension "${pluginId}/${extensionTitle}" failed to load.`, { message: error.message, componentStack: errorInfo.componentStack ?? '', - digest: errorInfo.digest ?? '', }); }} fallback={() => { diff --git a/public/app/features/variables/pickers/shared/VariableOptions.tsx b/public/app/features/variables/pickers/shared/VariableOptions.tsx index aca77c6af6c..af81affe5fc 100644 --- a/public/app/features/variables/pickers/shared/VariableOptions.tsx +++ b/public/app/features/variables/pickers/shared/VariableOptions.tsx @@ -11,7 +11,7 @@ import checkboxWhitePng from 'img/checkbox_white.png'; import { ALL_VARIABLE_VALUE } from '../../constants'; -export interface Props extends React.HTMLProps, Themeable2 { +export interface Props extends Omit, 'onToggle'>, Themeable2 { multi: boolean; values: VariableOption[]; selectedValues: VariableOption[];