mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DashNav: Pass typed event through the DashNav button onClick handler (#32084)
* Pass typed event thorough the DashNav button onClick handler Event.stopPropagation() method needs to be called in some cases. This change addresses typescript error Type '(event: ...) => void' is not assignable to type '() => void'. * Pass typed event thorough the DashNav button onClick handler * Import MouseEvent from React
This commit is contained in:
parent
2d72b4e69e
commit
8fafe95728
@ -1,5 +1,5 @@
|
|||||||
// Libraries
|
// Libraries
|
||||||
import React, { FunctionComponent } from 'react';
|
import React, { FunctionComponent, MouseEvent } from 'react';
|
||||||
import { css } from 'emotion';
|
import { css } from 'emotion';
|
||||||
// Components
|
// Components
|
||||||
import { IconName, IconType, IconSize, IconButton, useTheme, stylesFactory } from '@grafana/ui';
|
import { IconName, IconType, IconSize, IconButton, useTheme, stylesFactory } from '@grafana/ui';
|
||||||
@ -8,7 +8,7 @@ import { GrafanaTheme } from '@grafana/data';
|
|||||||
interface Props {
|
interface Props {
|
||||||
icon?: IconName;
|
icon?: IconName;
|
||||||
tooltip: string;
|
tooltip: string;
|
||||||
onClick?: () => void;
|
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
||||||
href?: string;
|
href?: string;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
iconType?: IconType;
|
iconType?: IconType;
|
||||||
|
Loading…
Reference in New Issue
Block a user