mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 07:17:08 -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
|
||||
import React, { FunctionComponent } from 'react';
|
||||
import React, { FunctionComponent, MouseEvent } from 'react';
|
||||
import { css } from 'emotion';
|
||||
// Components
|
||||
import { IconName, IconType, IconSize, IconButton, useTheme, stylesFactory } from '@grafana/ui';
|
||||
@ -8,7 +8,7 @@ import { GrafanaTheme } from '@grafana/data';
|
||||
interface Props {
|
||||
icon?: IconName;
|
||||
tooltip: string;
|
||||
onClick?: () => void;
|
||||
onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
|
||||
href?: string;
|
||||
children?: React.ReactNode;
|
||||
iconType?: IconType;
|
||||
|
Loading…
Reference in New Issue
Block a user