Chore: Avoid explicit React.FunctionComponent<Props> when possible (round 3) (#64839)

This commit is contained in:
Ryan McKinley
2023-03-16 07:56:26 -07:00
committed by GitHub
parent 0b506b4ccc
commit 2578774188
53 changed files with 116 additions and 157 deletions

View File

@@ -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));

View File

@@ -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(() => {