Chore: remove usages of FunctionComponent in elasticsearch plugin (#33175)

This commit is contained in:
Giordano Ricci
2021-05-04 16:23:19 +01:00
committed by GitHub
parent 3b11e7318a
commit 7cfd979cc1
21 changed files with 48 additions and 54 deletions

View File

@ -1,4 +1,4 @@
import React, { Context, createContext, FunctionComponent, useCallback, useContext } from 'react';
import React, { Context, createContext, PropsWithChildren, useCallback, useContext } from 'react';
import { ElasticDatasource } from '../../datasource';
import { combineReducers, useStatelessReducer, DispatchContext } from '../../hooks/useStatelessReducer';
import { ElasticsearchQuery } from '../../types';
@ -20,14 +20,14 @@ interface Props {
range: TimeRange;
}
export const ElasticsearchProvider: FunctionComponent<Props> = ({
export const ElasticsearchProvider = ({
children,
onChange,
onRunQuery,
query,
datasource,
range,
}) => {
}: PropsWithChildren<Props>) => {
const onStateChange = useCallback(
(query: ElasticsearchQuery) => {
onChange(query);