mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Avoid explicit React.FunctionComponent<Props> when possible (round 3) (#64839)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { FunctionComponent, useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { AnnotationQuery, DataQuery, EventBus } from '@grafana/data';
|
||||
|
||||
@@ -10,7 +10,7 @@ interface Props {
|
||||
onAnnotationChanged: (annotation: AnnotationQuery<DataQuery>) => void;
|
||||
}
|
||||
|
||||
export const Annotations: FunctionComponent<Props> = ({ annotations, onAnnotationChanged, events }) => {
|
||||
export const Annotations = ({ annotations, onAnnotationChanged, events }: Props) => {
|
||||
const [visibleAnnotations, setVisibleAnnotations] = useState<AnnotationQuery[]>([]);
|
||||
useEffect(() => {
|
||||
setVisibleAnnotations(annotations.filter((annotation) => annotation.hide !== true));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { FunctionComponent, useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
|
||||
@@ -10,7 +10,7 @@ interface Props {
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
export const SubMenuItems: FunctionComponent<Props> = ({ variables, readOnly }) => {
|
||||
export const SubMenuItems = ({ variables, readOnly }: Props) => {
|
||||
const [visibleVariables, setVisibleVariables] = useState<VariableModel[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user