From 9efe076d0402b1e2fdf686e55930858db6d31f28 Mon Sep 17 00:00:00 2001 From: patrykkopycinski Date: Fri, 22 Nov 2019 13:12:30 +0100 Subject: [PATCH] [7.x] Update deprecated React.SFC and React.StatelessComponent types (#50852) (#51336) --- TYPESCRIPT.md | 6 +++--- packages/eslint-config-kibana/typescript.js | 21 ++++++++++++++++++- packages/kbn-i18n/package.json | 2 +- packages/kbn-ui-framework/package.json | 4 ++-- src/core/public/application/ui/app_router.tsx | 2 +- .../filter/filter_bar/filter_view/index.tsx | 4 ++-- .../react/inject_ui_capabilities.test.tsx | 8 +++---- .../legacy/inject_ui_capabilities.test.tsx | 8 +++---- .../react/ui_capabilities_provider.tsx | 2 +- src/legacy/ui/public/i18n/index.tsx | 2 +- src/legacy/ui/public/management/index.d.ts | 4 ++-- typings/@elastic/eui/index.d.ts | 6 +++--- .../app/ErrorGroupOverview/index.tsx | 2 +- .../SpanFlyout/TruncateHeightSection.tsx | 2 +- .../Waterfall/WaterfallItem.tsx | 2 +- .../WaterfallWithSummmary/index.tsx | 2 +- .../public/components/shared/EmptyMessage.tsx | 2 +- .../shared/HeightRetainer/index.tsx | 2 +- .../Links/DiscoverLinks/DiscoverErrorLink.tsx | 2 +- .../Links/DiscoverLinks/DiscoverSpanLink.tsx | 2 +- .../DiscoverLinks/DiscoverTransactionLink.tsx | 2 +- .../Links/MachineLearningLinks/MLJobLink.tsx | 2 +- .../shared/Stacktrace/FrameHeading.tsx | 2 +- .../ChoroplethMap/ChoroplethToolTip.tsx | 2 +- .../TransactionCharts/ChoroplethMap/index.tsx | 2 +- .../DurationByCountryMap/index.tsx | 2 +- .../components/autocomplete_field/index.tsx | 2 +- .../autocomplete_field/suggestion_item.tsx | 2 +- .../public/components/config_list.tsx | 2 +- .../public/components/inputs/select.tsx | 2 +- .../public/components/layouts/no_data.tsx | 2 +- .../public/components/layouts/walkthrough.tsx | 2 +- .../public/components/loading.tsx | 2 +- .../navigation/breadcrumb/breadcrumb.tsx | 2 +- .../components/navigation/child_routes.tsx | 4 ++-- .../table/controls/option_control.tsx | 2 +- .../public/containers/with_url_state.tsx | 2 +- .../pages/walkthrough/initial/index.tsx | 2 +- .../plugins/beats_management/types/eui.d.ts | 2 +- .../beats_management/types/formsy.d.ts | 6 +++--- .../workpad/workpad_app/workpad_telemetry.tsx | 4 ++-- .../autocomplete_field/autocomplete_field.tsx | 2 +- .../autocomplete_field/suggestion_item.tsx | 2 +- .../components/empty_states/no_data.tsx | 2 +- .../components/empty_states/no_indices.tsx | 2 +- .../infra/public/components/error_page.tsx | 2 +- .../logging/log_minimap/density_chart.tsx | 2 +- .../log_minimap/highlighted_interval.tsx | 2 +- .../logging/log_minimap/time_ruler.tsx | 2 +- .../log_text_stream/loading_item_view.tsx | 2 +- .../components/waffle/gradient_legend.tsx | 2 +- .../components/waffle/group_of_groups.tsx | 2 +- .../components/waffle/group_of_nodes.tsx | 2 +- .../infra/public/components/waffle/legend.tsx | 2 +- .../infra/public/components/waffle/map.tsx | 2 +- .../public/components/waffle/steps_legend.tsx | 2 +- .../containers/logs/with_log_filter.tsx | 2 +- .../containers/waffle/with_waffle_filters.tsx | 2 +- .../plugins/infra/public/pages/error.tsx | 4 ++-- .../infrastructure/snapshot/page_content.tsx | 2 +- .../infra/public/pages/link_to/link_to.tsx | 2 +- x-pack/legacy/plugins/infra/public/routes.tsx | 2 +- x-pack/legacy/plugins/infra/types/eui.d.ts | 4 ++-- .../plugins/infra/types/eui_experimental.d.ts | 14 ++++++------- .../delete_annotation_modal/index.tsx | 2 +- .../components/exploration/exploration.tsx | 2 +- .../regression_exploration.tsx | 2 +- .../ml/public/util/observable_utils.test.tsx | 2 +- .../public/components/report_listing.tsx | 2 +- .../authentication_state_page.tsx | 2 +- .../components/account_management_page.tsx | 2 +- .../disabled_login_form.tsx | 2 +- .../privilege_display.tsx | 10 ++++----- .../app/components/data_placeholder.tsx | 2 +- .../app/components/repository_type_logo.tsx | 2 +- .../snapshot_details/tabs/snapshot_state.tsx | 2 +- .../snapshot_details/tabs/tab_failures.tsx | 2 +- .../snapshot_details/tabs/tab_summary.tsx | 2 +- .../spaces/public/components/space_avatar.tsx | 4 ++-- .../confirm_alter_active_space_modal.tsx | 2 +- .../components/spaces_description.tsx | 4 ++-- .../components/spaces_header_nav_button.tsx | 2 +- .../aggregation_dropdown/dropdown.tsx | 2 +- .../aggregation_list/agg_label_form.tsx | 2 +- .../components/aggregation_list/list_form.tsx | 7 +------ .../aggregation_list/list_summary.tsx | 2 +- .../aggregation_list/popover_form.tsx | 7 +------ .../group_by_list/group_by_label_form.tsx | 2 +- .../group_by_list/group_by_label_summary.tsx | 2 +- .../components/group_by_list/list_form.tsx | 2 +- .../components/group_by_list/list_summary.tsx | 2 +- .../components/group_by_list/popover_form.tsx | 7 +------ .../source_index_preview/expanded_row.tsx | 2 +- .../source_index_preview.tsx | 4 ++-- .../use_source_index_data.test.tsx | 4 ++-- .../step_create/step_create_form.tsx | 4 ++-- .../step_create/step_create_summary.tsx | 4 ++-- .../components/step_define/pivot_preview.tsx | 8 +++---- .../step_define/step_define_form.tsx | 4 ++-- .../use_pivot_preview_data.test.tsx | 4 ++-- .../step_details/step_details_form.tsx | 4 ++-- .../step_details/step_details_summary.tsx | 4 ++-- .../components/wizard/wizard.tsx | 6 +++--- .../components/wizard_nav/wizard_nav.tsx | 4 ++-- .../transform_list/expanded_row.tsx | 4 ++-- .../expanded_row_details_pane.tsx | 6 +++--- .../transform_list/expanded_row_json_pane.tsx | 4 ++-- .../expanded_row_messages_pane.tsx | 2 +- .../plugins/upgrade_assistant/public/app.tsx | 2 +- .../public/components/error_banner.tsx | 2 +- .../public/components/latest_minor_banner.tsx | 2 +- .../components/tabs/checkup/controls.tsx | 4 ++-- .../tabs/checkup/deprecations/cell.tsx | 4 ++-- .../checkup/deprecations/count_summary.tsx | 4 ++-- .../tabs/checkup/deprecations/grouped.tsx | 4 ++-- .../tabs/checkup/deprecations/health.tsx | 6 +++--- .../tabs/checkup/deprecations/list.tsx | 10 ++++----- .../reindex/flyout/checklist_step.tsx | 2 +- .../deprecations/reindex/flyout/progress.tsx | 6 +++--- .../reindex/flyout/step_progress.tsx | 6 +++--- .../reindex/flyout/warnings_step.tsx | 2 +- .../components/tabs/checkup/filter_bar.tsx | 2 +- .../components/tabs/checkup/group_by_bar.tsx | 2 +- .../public/components/tabs/overview/index.tsx | 4 ++-- .../public/components/tabs/overview/steps.tsx | 9 +++++--- x-pack/typings/@elastic/eui/index.d.ts | 4 ++-- yarn.lock | 4 ++-- 127 files changed, 217 insertions(+), 210 deletions(-) diff --git a/TYPESCRIPT.md b/TYPESCRIPT.md index 0c28060de40e5..7be9a5e4f3b17 100644 --- a/TYPESCRIPT.md +++ b/TYPESCRIPT.md @@ -21,7 +21,7 @@ The first thing that will probably happen when you convert a `.js` file in our s declare module '@elastic/eui' { // Add your types here - export const EuiPopoverTitle: React.SFC; + export const EuiPopoverTitle: React.FC; ... } ``` @@ -47,13 +47,13 @@ Since `@elastic/eui` already ships with a module declaration, any local addition // file `typings/@elastic/eui/index.d.ts` import { CommonProps } from '@elastic/eui'; -import { SFC } from 'react'; +import { FC } from 'react'; declare module '@elastic/eui' { export type EuiNewComponentProps = CommonProps & { additionalProp: string; }; - export const EuiNewComponent: SFC; + export const EuiNewComponent: FC; } ``` diff --git a/packages/eslint-config-kibana/typescript.js b/packages/eslint-config-kibana/typescript.js index 30c12e7fc203b..30c59f5e41801 100644 --- a/packages/eslint-config-kibana/typescript.js +++ b/packages/eslint-config-kibana/typescript.js @@ -71,7 +71,26 @@ module.exports = { // Old recommended tslint rules '@typescript-eslint/adjacent-overload-signatures': 'error', '@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }], - '@typescript-eslint/ban-types': 'error', + '@typescript-eslint/ban-types': ['error', { + types: { + SFC: { + message: 'Use FC or FunctionComponent instead.', + fixWith: 'FC' + }, + 'React.SFC': { + message: 'Use FC or FunctionComponent instead.', + fixWith: 'React.FC' + }, + StatelessComponent: { + message: 'Use FunctionComponent instead.', + fixWith: 'FunctionComponent' + }, + 'React.StatelessComponent': { + message: 'Use FunctionComponent instead.', + fixWith: 'React.FunctionComponent' + } + } + }], 'camelcase': 'off', '@typescript-eslint/camelcase': ['error', { 'properties': 'never', diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 1fb9a2a42ed6c..f599b5bac1995 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -28,7 +28,7 @@ "intl-messageformat": "^2.2.0", "intl-relativeformat": "^2.1.0", "prop-types": "^15.6.2", - "react": "^16.6.0", + "react": "^16.8.0", "react-intl": "^2.8.0" } } diff --git a/packages/kbn-ui-framework/package.json b/packages/kbn-ui-framework/package.json index ca594fe44b6c7..472c801721ecf 100644 --- a/packages/kbn-ui-framework/package.json +++ b/packages/kbn-ui-framework/package.json @@ -19,7 +19,7 @@ "focus-trap-react": "^3.1.1", "lodash": "npm:@elastic/lodash@3.10.1-kibana3", "prop-types": "15.6.0", - "react": "^16.2.0", + "react": "^16.8.0", "react-ace": "^5.9.0", "react-color": "^2.13.8", "tabbable": "1.1.3", @@ -57,7 +57,7 @@ "postcss": "^7.0.5", "postcss-loader": "^3.0.0", "raw-loader": "^3.1.0", - "react-dom": "^16.2.0", + "react-dom": "^16.8.0", "react-redux": "^5.0.6", "react-router": "^3.2.0", "react-router-redux": "^4.0.8", diff --git a/src/core/public/application/ui/app_router.tsx b/src/core/public/application/ui/app_router.tsx index 9d8acf1978556..b574bf16278e2 100644 --- a/src/core/public/application/ui/app_router.tsx +++ b/src/core/public/application/ui/app_router.tsx @@ -39,7 +39,7 @@ interface Props { redirectTo?: (path: string) => void; } -export const AppRouter: React.StatelessComponent = ({ +export const AppRouter: React.FunctionComponent = ({ history, redirectTo = (path: string) => (window.location.href = path), ...otherProps diff --git a/src/legacy/core_plugins/data/public/filter/filter_bar/filter_view/index.tsx b/src/legacy/core_plugins/data/public/filter/filter_bar/filter_view/index.tsx index fee043764d8d7..39d4a80cdf540 100644 --- a/src/legacy/core_plugins/data/public/filter/filter_bar/filter_view/index.tsx +++ b/src/legacy/core_plugins/data/public/filter/filter_bar/filter_view/index.tsx @@ -19,7 +19,7 @@ import { EuiBadge, useInnerText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import { FilterLabel } from '../filter_editor/lib/filter_label'; import { esFilters } from '../../../../../../../plugins/data/public'; @@ -29,7 +29,7 @@ interface Props { [propName: string]: any; } -export const FilterView: SFC = ({ +export const FilterView: FC = ({ filter, iconOnClick, onClick, diff --git a/src/legacy/ui/public/capabilities/react/inject_ui_capabilities.test.tsx b/src/legacy/ui/public/capabilities/react/inject_ui_capabilities.test.tsx index ff46b6ec34a86..10fb58783481d 100644 --- a/src/legacy/ui/public/capabilities/react/inject_ui_capabilities.test.tsx +++ b/src/legacy/ui/public/capabilities/react/inject_ui_capabilities.test.tsx @@ -35,18 +35,18 @@ import { injectUICapabilities } from './inject_ui_capabilities'; import { UICapabilitiesProvider } from './ui_capabilities_provider'; describe('injectUICapabilities', () => { - it('provides UICapabilities to SFCs', () => { - interface SFCProps { + it('provides UICapabilities to FCs', () => { + interface FCProps { uiCapabilities: UICapabilities; } - const MySFC = injectUICapabilities(({ uiCapabilities }: SFCProps) => { + const MyFC = injectUICapabilities(({ uiCapabilities }: FCProps) => { return {uiCapabilities.uiCapability2.nestedProp}; }); const wrapper = mount( - + ); diff --git a/src/legacy/ui/public/capabilities/react/legacy/inject_ui_capabilities.test.tsx b/src/legacy/ui/public/capabilities/react/legacy/inject_ui_capabilities.test.tsx index 76f1dd8016313..dbc7cd03e27a3 100644 --- a/src/legacy/ui/public/capabilities/react/legacy/inject_ui_capabilities.test.tsx +++ b/src/legacy/ui/public/capabilities/react/legacy/inject_ui_capabilities.test.tsx @@ -35,18 +35,18 @@ import { injectUICapabilities } from './inject_ui_capabilities'; import { UICapabilitiesProvider } from './ui_capabilities_provider'; describe('injectUICapabilities', () => { - it('provides UICapabilities to SFCs', () => { - interface SFCProps { + it('provides UICapabilities to FCs', () => { + interface FCProps { uiCapabilities: UICapabilities; } - const MySFC = injectUICapabilities(({ uiCapabilities }: SFCProps) => { + const MyFC = injectUICapabilities(({ uiCapabilities }: FCProps) => { return {uiCapabilities.uiCapability2.nestedProp}; }); const wrapper = mount( - + ); diff --git a/src/legacy/ui/public/capabilities/react/ui_capabilities_provider.tsx b/src/legacy/ui/public/capabilities/react/ui_capabilities_provider.tsx index 3871147107439..b6ffca350239c 100644 --- a/src/legacy/ui/public/capabilities/react/ui_capabilities_provider.tsx +++ b/src/legacy/ui/public/capabilities/react/ui_capabilities_provider.tsx @@ -21,7 +21,7 @@ import React from 'react'; import { UICapabilitiesContext } from './ui_capabilities_context'; import { capabilities } from '..'; -export const UICapabilitiesProvider: React.SFC = props => ( +export const UICapabilitiesProvider: React.FC = props => ( {props.children} diff --git a/src/legacy/ui/public/i18n/index.tsx b/src/legacy/ui/public/i18n/index.tsx index 3fd4137cab625..4d0f5d3a5bd56 100644 --- a/src/legacy/ui/public/i18n/index.tsx +++ b/src/legacy/ui/public/i18n/index.tsx @@ -27,7 +27,7 @@ import { npStart } from 'ui/new_platform'; export const I18nContext = npStart.core.i18n.Context; export function wrapInI18nContext

(ComponentToWrap: React.ComponentType

) { - const ContextWrapper: React.SFC

= props => { + const ContextWrapper: React.FC

= props => { return ( diff --git a/src/legacy/ui/public/management/index.d.ts b/src/legacy/ui/public/management/index.d.ts index b5d927cd90433..7880e1d5d0295 100644 --- a/src/legacy/ui/public/management/index.d.ts +++ b/src/legacy/ui/public/management/index.d.ts @@ -21,10 +21,10 @@ declare module 'ui/management' { export const PAGE_TITLE_COMPONENT: string; export const PAGE_SUBTITLE_COMPONENT: string; export const PAGE_FOOTER_COMPONENT: string; - export const SidebarNav: React.SFC; + export const SidebarNav: React.FC; export function registerSettingsComponent( id: string, - component: string | React.SFC, + component: string | React.FC, allowOverride: boolean ): void; export const management: any; // TODO - properly provide types diff --git a/typings/@elastic/eui/index.d.ts b/typings/@elastic/eui/index.d.ts index 39fc30230de18..dc4d0d778fc55 100644 --- a/typings/@elastic/eui/index.d.ts +++ b/typings/@elastic/eui/index.d.ts @@ -21,9 +21,9 @@ import { Direction } from '@elastic/eui/src/services/sort/sort_direction'; // TODO: Remove once typescript definitions are in EUI declare module '@elastic/eui' { - export const EuiSideNav: React.SFC; - export const EuiDescribedFormGroup: React.SFC; - export const EuiCodeEditor: React.SFC; + export const EuiSideNav: React.FC; + export const EuiDescribedFormGroup: React.FC; + export const EuiCodeEditor: React.FC; export const Query: any; export interface EuiTableCriteria { diff --git a/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/index.tsx index fe1a80d702dba..f2d2f28fc975a 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/ErrorGroupOverview/index.tsx @@ -21,7 +21,7 @@ import { useTrackPageview } from '../../../../../infra/public'; import { PROJECTION } from '../../../../common/projections/typings'; import { LocalUIFilters } from '../../shared/LocalUIFilters'; -const ErrorGroupOverview: React.SFC = () => { +const ErrorGroupOverview: React.FC = () => { const { urlParams, uiFilters } = useUrlParams(); const { serviceName, start, end, sortField, sortDirection } = urlParams; diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/TruncateHeightSection.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/TruncateHeightSection.tsx index b01dc2c5398e2..a42b2435ff914 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/TruncateHeightSection.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/SpanFlyout/TruncateHeightSection.tsx @@ -19,7 +19,7 @@ interface Props { previewHeight: number; } -export const TruncateHeightSection: React.SFC = ({ +export const TruncateHeightSection: React.FC = ({ children, previewHeight }) => { diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx index 339346ae2961e..40dc60c1efacd 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/WaterfallContainer/Waterfall/WaterfallItem.tsx @@ -112,7 +112,7 @@ interface SpanActionToolTipProps { item?: IWaterfallItem; } -const SpanActionToolTip: React.SFC = ({ +const SpanActionToolTip: React.FC = ({ item, children }) => { diff --git a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/index.tsx b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/index.tsx index e518751e4153e..fb37bf44c2f32 100644 --- a/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/app/TransactionDetails/WaterfallWithSummmary/index.tsx @@ -110,7 +110,7 @@ interface Props { isLoading: boolean; } -export const WaterfallWithSummmary: React.SFC = ({ +export const WaterfallWithSummmary: React.FC = ({ urlParams, location, waterfall, diff --git a/x-pack/legacy/plugins/apm/public/components/shared/EmptyMessage.tsx b/x-pack/legacy/plugins/apm/public/components/shared/EmptyMessage.tsx index f18d12c4f6edc..3c279d525410c 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/EmptyMessage.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/EmptyMessage.tsx @@ -14,7 +14,7 @@ interface Props { hideSubheading?: boolean; } -const EmptyMessage: React.SFC = ({ +const EmptyMessage: React.FC = ({ heading = i18n.translate('xpack.apm.emptyMessage.noDataFoundLabel', { defaultMessage: 'No data found.' }), diff --git a/x-pack/legacy/plugins/apm/public/components/shared/HeightRetainer/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/HeightRetainer/index.tsx index e6f4487312429..aeb2d25ffeae1 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/HeightRetainer/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/HeightRetainer/index.tsx @@ -6,7 +6,7 @@ import React, { useEffect, useRef } from 'react'; -export const HeightRetainer: React.SFC = props => { +export const HeightRetainer: React.FC = props => { const containerElement = useRef(null); const minHeight = useRef(0); diff --git a/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorLink.tsx b/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorLink.tsx index 827b824e5d05c..38f7046685636 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorLink.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverErrorLink.tsx @@ -32,7 +32,7 @@ function getDiscoverQuery(error: APMError, kuery?: string) { }; } -const DiscoverErrorLink: React.SFC<{ +const DiscoverErrorLink: React.FC<{ readonly error: APMError; readonly kuery?: string; }> = ({ error, kuery, children }) => { diff --git a/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverSpanLink.tsx b/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverSpanLink.tsx index 48dd4e5b57a43..374454b74fce4 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverSpanLink.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverSpanLink.tsx @@ -22,7 +22,7 @@ function getDiscoverQuery(span: Span) { }; } -export const DiscoverSpanLink: React.SFC<{ +export const DiscoverSpanLink: React.FC<{ readonly span: Span; }> = ({ span, children }) => { return ; diff --git a/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverTransactionLink.tsx b/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverTransactionLink.tsx index df86008c193ff..0e381c490f8b4 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverTransactionLink.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/Links/DiscoverLinks/DiscoverTransactionLink.tsx @@ -32,7 +32,7 @@ export function getDiscoverQuery(transaction: Transaction) { }; } -export const DiscoverTransactionLink: React.SFC<{ +export const DiscoverTransactionLink: React.FC<{ readonly transaction: Transaction; }> = ({ transaction, children }) => { return ( diff --git a/x-pack/legacy/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLJobLink.tsx b/x-pack/legacy/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLJobLink.tsx index 1cf10d13e57bb..81c5d17d491c0 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLJobLink.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/Links/MachineLearningLinks/MLJobLink.tsx @@ -13,7 +13,7 @@ interface Props { transactionType?: string; } -export const MLJobLink: React.SFC = ({ +export const MLJobLink: React.FC = ({ serviceName, transactionType, children diff --git a/x-pack/legacy/plugins/apm/public/components/shared/Stacktrace/FrameHeading.tsx b/x-pack/legacy/plugins/apm/public/components/shared/Stacktrace/FrameHeading.tsx index 5ec6a2289f9c9..84c2801a45049 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/Stacktrace/FrameHeading.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/Stacktrace/FrameHeading.tsx @@ -30,7 +30,7 @@ interface Props { isLibraryFrame: boolean; } -const FrameHeading: React.SFC = ({ stackframe, isLibraryFrame }) => { +const FrameHeading: React.FC = ({ stackframe, isLibraryFrame }) => { const FileDetail = isLibraryFrame ? LibraryFrameFileDetail : AppFrameFileDetail; diff --git a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/ChoroplethToolTip.tsx b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/ChoroplethToolTip.tsx index d2b6970841bdc..6db91b4368aa9 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/ChoroplethToolTip.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/ChoroplethToolTip.tsx @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import { asDuration, asInteger } from '../../../../../utils/formatters'; import { fontSizes } from '../../../../../style/variables'; -export const ChoroplethToolTip: React.SFC<{ +export const ChoroplethToolTip: React.FC<{ name: string; value: number; docCount: number; diff --git a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/index.tsx index bb4974d6d51fa..e98b695c14763 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/ChoroplethMap/index.tsx @@ -65,7 +65,7 @@ const getMin = (items: ChoroplethItem[]) => const getMax = (items: ChoroplethItem[]) => Math.max(...items.map(item => item.value)); -export const ChoroplethMap: React.SFC = props => { +export const ChoroplethMap: React.FC = props => { const { items } = props; const containerRef = useRef(null); diff --git a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/DurationByCountryMap/index.tsx b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/DurationByCountryMap/index.tsx index bea858d1358c5..0761cec53fc2e 100644 --- a/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/DurationByCountryMap/index.tsx +++ b/x-pack/legacy/plugins/apm/public/components/shared/charts/TransactionCharts/DurationByCountryMap/index.tsx @@ -11,7 +11,7 @@ import { useAvgDurationByCountry } from '../../../../../hooks/useAvgDurationByCo import { ChoroplethMap } from '../ChoroplethMap'; -export const DurationByCountryMap: React.SFC = () => { +export const DurationByCountryMap: React.FC = () => { const { data } = useAvgDurationByCountry(); return ( diff --git a/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/index.tsx b/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/index.tsx index 4270a5ae1ec8d..1f49711ae5e4a 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/index.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/index.tsx @@ -265,7 +265,7 @@ const withSuggestionsHidden = (state: AutocompleteFieldState) => ({ selectedIndex: null, }); -const FixedEuiFieldSearch: React.SFC & +const FixedEuiFieldSearch: React.FC & EuiFieldSearchProps & { inputRef?: (element: HTMLInputElement | null) => void; onSearch: (value: string) => void; diff --git a/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx b/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx index a90451c388d7a..a753a944a2ecb 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/autocomplete_field/suggestion_item.tsx @@ -18,7 +18,7 @@ interface SuggestionItemProps { suggestion: AutocompleteSuggestion; } -export const SuggestionItem: React.SFC = props => { +export const SuggestionItem: React.FC = props => { const { isSelected, onClick, onMouseEnter, suggestion } = props; return ( diff --git a/x-pack/legacy/plugins/beats_management/public/components/config_list.tsx b/x-pack/legacy/plugins/beats_management/public/components/config_list.tsx index f860188e66800..3ffd42c5201f9 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/config_list.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/config_list.tsx @@ -28,7 +28,7 @@ const pagination = { hidePerPageOptions: true, }; -const ConfigListUi: React.SFC = props => ( +const ConfigListUi: React.FC = props => ( ; +const FixedSelect = EuiSelect as React.FC; interface ComponentProps extends FormsyInputProps, CommonProps { instantValidation: boolean; diff --git a/x-pack/legacy/plugins/beats_management/public/components/layouts/no_data.tsx b/x-pack/legacy/plugins/beats_management/public/components/layouts/no_data.tsx index 8d4c7703dfc4d..e525ea4be46e0 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/layouts/no_data.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/layouts/no_data.tsx @@ -14,7 +14,7 @@ interface LayoutProps { modalClosePath?: string; } -export const NoDataLayout: React.SFC = withRouter( +export const NoDataLayout: React.FC = withRouter( ({ actionSection, title, modalClosePath, children, history }) => { return ( diff --git a/x-pack/legacy/plugins/beats_management/public/components/layouts/walkthrough.tsx b/x-pack/legacy/plugins/beats_management/public/components/layouts/walkthrough.tsx index 0a63ccdc87239..bcedfc063b0e5 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/layouts/walkthrough.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/layouts/walkthrough.tsx @@ -24,7 +24,7 @@ interface LayoutProps { activePath: string; } -export const WalkthroughLayout: React.SFC = ({ +export const WalkthroughLayout: React.FC = ({ walkthroughSteps, title, activePath, diff --git a/x-pack/legacy/plugins/beats_management/public/components/loading.tsx b/x-pack/legacy/plugins/beats_management/public/components/loading.tsx index f1c2455ec85b9..625ecef3fa3d0 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/loading.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/loading.tsx @@ -7,7 +7,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; import * as React from 'react'; -export const Loading: React.SFC<{}> = () => ( +export const Loading: React.FC<{}> = () => ( diff --git a/x-pack/legacy/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx b/x-pack/legacy/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx index 7948501f5f873..efe5eb25a0ac1 100644 --- a/x-pack/legacy/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx +++ b/x-pack/legacy/plugins/beats_management/public/components/navigation/breadcrumb/breadcrumb.tsx @@ -48,7 +48,7 @@ interface BreadcrumbProps extends RouteProps { parentBreadcrumbs?: BreadcrumbData[]; } -export const Breadcrumb: React.SFC = ({ title, path, parentBreadcrumbs }) => ( +export const Breadcrumb: React.FC = ({ title, path, parentBreadcrumbs }) => ( {context => ( = (props: ComponentProps) => { +export const OptionControl: React.FC = (props: ComponentProps) => { switch (props.type) { case ActionComponentType.Action: if (!props.action) { diff --git a/x-pack/legacy/plugins/beats_management/public/containers/with_url_state.tsx b/x-pack/legacy/plugins/beats_management/public/containers/with_url_state.tsx index 0802b4d8ea7e8..29581508d2ad5 100644 --- a/x-pack/legacy/plugins/beats_management/public/containers/with_url_state.tsx +++ b/x-pack/legacy/plugins/beats_management/public/containers/with_url_state.tsx @@ -90,7 +90,7 @@ export const WithURLState = withRouter(WithURLStateComponent); export function withUrlState( UnwrappedComponent: React.ComponentType -): React.SFC { +): React.FC { return (origProps: OP) => { return ( diff --git a/x-pack/legacy/plugins/beats_management/public/pages/walkthrough/initial/index.tsx b/x-pack/legacy/plugins/beats_management/public/pages/walkthrough/initial/index.tsx index 26f2aa80de763..a78bf3fa7cf8e 100644 --- a/x-pack/legacy/plugins/beats_management/public/pages/walkthrough/initial/index.tsx +++ b/x-pack/legacy/plugins/beats_management/public/pages/walkthrough/initial/index.tsx @@ -17,7 +17,7 @@ type Props = AppPageProps & { intl: InjectedIntl; }; -const InitialWalkthroughPageComponent: React.SFC = props => { +const InitialWalkthroughPageComponent: React.FC = props => { if (props.location.pathname === '/walkthrough/initial') { return ( ; + import React, { FC } from 'react'; + let Formsy: FC; export interface FormsyInputProps { getErrorMessage(): any; getValue(): any; @@ -43,6 +43,6 @@ declare module 'formsy-react' { // function withFormsy( // component: // | React.Component - // | SFC + // | FC // ): React.Component; } diff --git a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx b/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx index 720f1726c1e3c..39ff3f45d602a 100644 --- a/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx +++ b/x-pack/legacy/plugins/canvas/public/apps/workpad/workpad_app/workpad_telemetry.tsx @@ -80,10 +80,10 @@ function areAllElementsInResolvedArgs(workpad: Workpad, resolvedArgs: ResolvedAr export const withUnconnectedElementsLoadedTelemetry = function

( Component: React.ComponentType

, trackMetric = trackCanvasUiMetric -): React.SFC

{ +): React.FC

{ return function ElementsLoadedTelemetry( props: P & ElementsLoadedTelemetryProps - ): React.SFCElement

{ + ): React.FunctionComponentElement

{ const { telemetryElementCounts, workpad, telemetryResolvedArgs, ...other } = props; const [currentWorkpadId, setWorkpadId] = useState(undefined); diff --git a/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx b/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx index c569a5d01a1a4..4c215835ca240 100644 --- a/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx +++ b/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx @@ -302,7 +302,7 @@ const withUnfocused = (state: AutocompleteFieldState) => ({ isFocused: false, }); -const FixedEuiFieldSearch: React.SFC & +const FixedEuiFieldSearch: React.FC & EuiFieldSearchProps & { inputRef?: (element: HTMLInputElement | null) => void; onSearch: (value: string) => void; diff --git a/x-pack/legacy/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx b/x-pack/legacy/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx index 6ddcd675487ba..0c29b1f51b07e 100644 --- a/x-pack/legacy/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx +++ b/x-pack/legacy/plugins/infra/public/components/autocomplete_field/suggestion_item.tsx @@ -18,7 +18,7 @@ interface Props { suggestion: AutocompleteSuggestion; } -export const SuggestionItem: React.SFC = props => { +export const SuggestionItem: React.FC = props => { const { isSelected, onClick, onMouseEnter, suggestion } = props; return ( diff --git a/x-pack/legacy/plugins/infra/public/components/empty_states/no_data.tsx b/x-pack/legacy/plugins/infra/public/components/empty_states/no_data.tsx index be0f1eb78efee..7519e3fe10779 100644 --- a/x-pack/legacy/plugins/infra/public/components/empty_states/no_data.tsx +++ b/x-pack/legacy/plugins/infra/public/components/empty_states/no_data.tsx @@ -17,7 +17,7 @@ interface NoDataProps { testString?: string; } -export const NoData: React.SFC = ({ +export const NoData: React.FC = ({ titleText, bodyText, refetchText, diff --git a/x-pack/legacy/plugins/infra/public/components/empty_states/no_indices.tsx b/x-pack/legacy/plugins/infra/public/components/empty_states/no_indices.tsx index a1aadd7542c14..bfe282d2cee04 100644 --- a/x-pack/legacy/plugins/infra/public/components/empty_states/no_indices.tsx +++ b/x-pack/legacy/plugins/infra/public/components/empty_states/no_indices.tsx @@ -16,7 +16,7 @@ interface NoIndicesProps { 'data-test-subj'?: string; } -export const NoIndices: React.SFC = ({ actions, message, title, ...rest }) => ( +export const NoIndices: React.FC = ({ actions, message, title, ...rest }) => ( {title}} body={

{message}

} diff --git a/x-pack/legacy/plugins/infra/public/components/error_page.tsx b/x-pack/legacy/plugins/infra/public/components/error_page.tsx index cf16229a8dc4b..fea76c83292c2 100644 --- a/x-pack/legacy/plugins/infra/public/components/error_page.tsx +++ b/x-pack/legacy/plugins/infra/public/components/error_page.tsx @@ -24,7 +24,7 @@ interface Props { shortMessage: React.ReactNode; } -export const ErrorPage: React.SFC = ({ detailedMessage, retry, shortMessage }) => ( +export const ErrorPage: React.FC = ({ detailedMessage, retry, shortMessage }) => ( = ({ +export const DensityChart: React.FC = ({ buckets, start, end, diff --git a/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/highlighted_interval.tsx b/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/highlighted_interval.tsx index 08902f2b1644b..4711a7ac6ffde 100644 --- a/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/highlighted_interval.tsx +++ b/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/highlighted_interval.tsx @@ -17,7 +17,7 @@ interface HighlightedIntervalProps { target: number | null; } -export const HighlightedInterval: React.SFC = ({ +export const HighlightedInterval: React.FC = ({ className, end, getPositionOfTime, diff --git a/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx b/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx index eb49c8d010a90..c72403539563d 100644 --- a/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx +++ b/x-pack/legacy/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx @@ -17,7 +17,7 @@ interface TimeRulerProps { width: number; } -export const TimeRuler: React.SFC = ({ end, height, start, tickCount, width }) => { +export const TimeRuler: React.FC = ({ end, height, start, tickCount, width }) => { const yScale = scaleTime() .domain([start, end]) .range([0, height]); diff --git a/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx b/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx index 752a0d6e27a7f..549ca4c1ae047 100644 --- a/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx +++ b/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/loading_item_view.tsx @@ -114,7 +114,7 @@ interface ProgressEntryProps { isLoading: boolean; } -const ProgressEntry: React.SFC = props => { +const ProgressEntry: React.FC = props => { const { alignment, children, className, color, isLoading } = props; // NOTE: styled-components seems to make all props in EuiProgress required, so this diff --git a/x-pack/legacy/plugins/infra/public/components/waffle/gradient_legend.tsx b/x-pack/legacy/plugins/infra/public/components/waffle/gradient_legend.tsx index 37a4b4bc563a0..3dcc40818b4d5 100644 --- a/x-pack/legacy/plugins/infra/public/components/waffle/gradient_legend.tsx +++ b/x-pack/legacy/plugins/infra/public/components/waffle/gradient_legend.tsx @@ -35,7 +35,7 @@ const createTickRender = (bounds: InfraWaffleMapBounds, formatter: InfraFormatte ); }; -export const GradientLegend: React.SFC = ({ legend, bounds, formatter }) => { +export const GradientLegend: React.FC = ({ legend, bounds, formatter }) => { const maxValue = legend.rules.reduce((acc, rule) => { return acc < rule.value ? rule.value : acc; }, 0); diff --git a/x-pack/legacy/plugins/infra/public/components/waffle/group_of_groups.tsx b/x-pack/legacy/plugins/infra/public/components/waffle/group_of_groups.tsx index bf10133d1f16e..3f456c3c8d406 100644 --- a/x-pack/legacy/plugins/infra/public/components/waffle/group_of_groups.tsx +++ b/x-pack/legacy/plugins/infra/public/components/waffle/group_of_groups.tsx @@ -26,7 +26,7 @@ interface Props { timeRange: InfraTimerangeInput; } -export const GroupOfGroups: React.SFC = props => { +export const GroupOfGroups: React.FC = props => { return ( diff --git a/x-pack/legacy/plugins/infra/public/components/waffle/group_of_nodes.tsx b/x-pack/legacy/plugins/infra/public/components/waffle/group_of_nodes.tsx index 04011904cdbba..bc7d31a301496 100644 --- a/x-pack/legacy/plugins/infra/public/components/waffle/group_of_nodes.tsx +++ b/x-pack/legacy/plugins/infra/public/components/waffle/group_of_nodes.tsx @@ -27,7 +27,7 @@ interface Props { timeRange: InfraTimerangeInput; } -export const GroupOfNodes: React.SFC = ({ +export const GroupOfNodes: React.FC = ({ group, options, formatter, diff --git a/x-pack/legacy/plugins/infra/public/components/waffle/legend.tsx b/x-pack/legacy/plugins/infra/public/components/waffle/legend.tsx index ee403aa59fe13..c7f647449606e 100644 --- a/x-pack/legacy/plugins/infra/public/components/waffle/legend.tsx +++ b/x-pack/legacy/plugins/infra/public/components/waffle/legend.tsx @@ -24,7 +24,7 @@ interface LegendControlOptions { bounds: InfraWaffleMapBounds; } -export const Legend: React.SFC = ({ dataBounds, legend, bounds, formatter }) => { +export const Legend: React.FC = ({ dataBounds, legend, bounds, formatter }) => { return ( diff --git a/x-pack/legacy/plugins/infra/public/components/waffle/map.tsx b/x-pack/legacy/plugins/infra/public/components/waffle/map.tsx index 14c15cfd0fe3e..ed7db4fe3dfe1 100644 --- a/x-pack/legacy/plugins/infra/public/components/waffle/map.tsx +++ b/x-pack/legacy/plugins/infra/public/components/waffle/map.tsx @@ -30,7 +30,7 @@ interface Props { dataBounds: InfraWaffleMapBounds; } -export const Map: React.SFC = ({ +export const Map: React.FC = ({ nodes, options, timeRange, diff --git a/x-pack/legacy/plugins/infra/public/components/waffle/steps_legend.tsx b/x-pack/legacy/plugins/infra/public/components/waffle/steps_legend.tsx index 2b55d5652ec4e..e251720795074 100644 --- a/x-pack/legacy/plugins/infra/public/components/waffle/steps_legend.tsx +++ b/x-pack/legacy/plugins/infra/public/components/waffle/steps_legend.tsx @@ -43,7 +43,7 @@ const createStep = (formatter: InfraFormatter) => (rule: InfraWaffleMapStepRule, ); }; -export const StepLegend: React.SFC = ({ legend, formatter }) => { +export const StepLegend: React.FC = ({ legend, formatter }) => { return {legend.rules.map(createStep(formatter))}; }; diff --git a/x-pack/legacy/plugins/infra/public/containers/logs/with_log_filter.tsx b/x-pack/legacy/plugins/infra/public/containers/logs/with_log_filter.tsx index 77b41f8a0b7e2..e06e83f08680c 100644 --- a/x-pack/legacy/plugins/infra/public/containers/logs/with_log_filter.tsx +++ b/x-pack/legacy/plugins/infra/public/containers/logs/with_log_filter.tsx @@ -63,7 +63,7 @@ type LogFilterUrlState = ReturnType = ({ indexPattern }) => ( +export const WithLogFilterUrlState: React.FC = ({ indexPattern }) => ( {({ applyFilterQuery, filterQuery }) => ( = ({ +export const WithWaffleFilterUrlState: React.FC = ({ indexPattern, }) => ( diff --git a/x-pack/legacy/plugins/infra/public/pages/error.tsx b/x-pack/legacy/plugins/infra/public/pages/error.tsx index 0c9431bf501da..b525dd9b165ba 100644 --- a/x-pack/legacy/plugins/infra/public/pages/error.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/error.tsx @@ -28,7 +28,7 @@ interface Props { message: string; } -export const Error: React.SFC = ({ message }) => { +export const Error: React.FC = ({ message }) => { return (
@@ -39,7 +39,7 @@ export const Error: React.SFC = ({ message }) => { ); }; -export const ErrorPageBody: React.SFC<{ message: string }> = ({ message }) => { +export const ErrorPageBody: React.FC<{ message: string }> = ({ message }) => { return ( diff --git a/x-pack/legacy/plugins/infra/public/pages/infrastructure/snapshot/page_content.tsx b/x-pack/legacy/plugins/infra/public/pages/infrastructure/snapshot/page_content.tsx index a489c9a8bd473..a041a2bfb3650 100644 --- a/x-pack/legacy/plugins/infra/public/pages/infrastructure/snapshot/page_content.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/infrastructure/snapshot/page_content.tsx @@ -14,7 +14,7 @@ import { WithOptions } from '../../../containers/with_options'; import { WithSource } from '../../../containers/with_source'; import { Layout } from '../../../components/inventory/layout'; -export const SnapshotPageContent: React.SFC = () => ( +export const SnapshotPageContent: React.FC = () => ( {({ configuration, createDerivedIndexPattern, sourceId }) => ( diff --git a/x-pack/legacy/plugins/infra/public/pages/link_to/link_to.tsx b/x-pack/legacy/plugins/infra/public/pages/link_to/link_to.tsx index 1318e9ca6c2c5..1e62af07224f1 100644 --- a/x-pack/legacy/plugins/infra/public/pages/link_to/link_to.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/link_to/link_to.tsx @@ -16,7 +16,7 @@ interface LinkToPageProps { match: RouteMatch<{}>; } -export const LinkToPage: React.SFC = props => ( +export const LinkToPage: React.FC = props => ( = ({ history, uiCapabilities }) => { +const PageRouterComponent: React.FC = ({ history, uiCapabilities }) => { return ( diff --git a/x-pack/legacy/plugins/infra/types/eui.d.ts b/x-pack/legacy/plugins/infra/types/eui.d.ts index e4e0e70ce630b..2907830ff882f 100644 --- a/x-pack/legacy/plugins/infra/types/eui.d.ts +++ b/x-pack/legacy/plugins/infra/types/eui.d.ts @@ -41,7 +41,7 @@ declare module '@elastic/eui' { toggleOpenOnMobile?: () => void; isOpenOnMobile?: boolean; }; - export const EuiSideNav: React.SFC; + export const EuiSideNav: React.FC; type EuiErrorBoundaryProps = CommonProps & { children: React.ReactNode; @@ -69,5 +69,5 @@ declare module '@elastic/eui' { cellProps?: any; responsive?: boolean; }; - export const EuiInMemoryTable: React.SFC; + export const EuiInMemoryTable: React.FC; } diff --git a/x-pack/legacy/plugins/infra/types/eui_experimental.d.ts b/x-pack/legacy/plugins/infra/types/eui_experimental.d.ts index 16320531f42b3..6b01bd8066adc 100644 --- a/x-pack/legacy/plugins/infra/types/eui_experimental.d.ts +++ b/x-pack/legacy/plugins/infra/types/eui_experimental.d.ts @@ -20,7 +20,7 @@ declare module '@elastic/eui/lib/experimental' { animateData?: boolean; marginLeft?: number; }; - export const EuiSeriesChart: React.SFC; + export const EuiSeriesChart: React.FC; type EuiSeriesProps = CommonProps & { data: Array<{ x: number; y: number; y0?: number }>; @@ -29,21 +29,21 @@ declare module '@elastic/eui/lib/experimental' { color?: string; marginLeft?: number; }; - export const EuiLineSeries: React.SFC; - export const EuiAreaSeries: React.SFC; - export const EuiBarSeries: React.SFC; + export const EuiLineSeries: React.FC; + export const EuiAreaSeries: React.FC; + export const EuiBarSeries: React.FC; type EuiYAxisProps = CommonProps & { tickFormat: (value: number) => string; marginLeft?: number; }; - export const EuiYAxis: React.SFC; + export const EuiYAxis: React.FC; type EuiXAxisProps = CommonProps & { tickFormat?: (value: number) => string; marginLeft?: number; }; - export const EuiXAxis: React.SFC; + export const EuiXAxis: React.FC; export interface EuiDataPoint { seriesIndex: number; @@ -66,5 +66,5 @@ declare module '@elastic/eui/lib/experimental' { titleFormat?: (dataPoints: EuiDataPoint[]) => EuiFormattedValue | undefined; itemsFormat?: (dataPoints: EuiDataPoint[]) => EuiFormattedValue[]; }; - export const EuiCrosshairX: React.SFC; + export const EuiCrosshairX: React.FC; } diff --git a/x-pack/legacy/plugins/ml/public/components/annotations/delete_annotation_modal/index.tsx b/x-pack/legacy/plugins/ml/public/components/annotations/delete_annotation_modal/index.tsx index 32e40b6edbed3..384ba67a62f8b 100644 --- a/x-pack/legacy/plugins/ml/public/components/annotations/delete_annotation_modal/index.tsx +++ b/x-pack/legacy/plugins/ml/public/components/annotations/delete_annotation_modal/index.tsx @@ -17,7 +17,7 @@ interface Props { isVisible: boolean; } -export const DeleteAnnotationModal: React.SFC = ({ +export const DeleteAnnotationModal: React.FC = ({ cancelAction, deleteAction, isVisible, diff --git a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx index 11bb62dec1624..9cc469f83a534 100644 --- a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx +++ b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/exploration/exploration.tsx @@ -77,7 +77,7 @@ interface GetDataFrameAnalyticsResponse { const PAGE_SIZE_OPTIONS = [5, 10, 25, 50]; -const ExplorationTitle: React.SFC<{ jobId: string }> = ({ jobId }) => ( +const ExplorationTitle: React.FC<{ jobId: string }> = ({ jobId }) => ( {i18n.translate('xpack.ml.dataframe.analytics.exploration.jobIdTitle', { diff --git a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/regression_exploration.tsx b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/regression_exploration.tsx index b188334934ae0..8ebbd8c401948 100644 --- a/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/regression_exploration.tsx +++ b/x-pack/legacy/plugins/ml/public/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/regression_exploration.tsx @@ -26,7 +26,7 @@ const LoadingPanel: FC = () => ( ); -export const ExplorationTitle: React.SFC<{ jobId: string }> = ({ jobId }) => ( +export const ExplorationTitle: React.FC<{ jobId: string }> = ({ jobId }) => ( {i18n.translate('xpack.ml.dataframe.analytics.regressionExploration.jobIdTitle', { diff --git a/x-pack/legacy/plugins/ml/public/util/observable_utils.test.tsx b/x-pack/legacy/plugins/ml/public/util/observable_utils.test.tsx index f256a1470f7f6..c95824fc5dc4d 100644 --- a/x-pack/legacy/plugins/ml/public/util/observable_utils.test.tsx +++ b/x-pack/legacy/plugins/ml/public/util/observable_utils.test.tsx @@ -20,7 +20,7 @@ describe('observable_utils', () => { const observable$ = new BehaviorSubject('initial text'); // a simple stateless component that just renders some text - const TestComponent: React.SFC = ({ testProp }) => { + const TestComponent: React.FC = ({ testProp }) => { return {testProp}; }; diff --git a/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx b/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx index 1a75b65f70eb4..34de855bacbb9 100644 --- a/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx +++ b/x-pack/legacy/plugins/reporting/public/components/report_listing.tsx @@ -6,7 +6,7 @@ // TODO: Remove once typescript definitions are in EUI declare module '@elastic/eui' { - export const EuiBasicTable: React.SFC; + export const EuiBasicTable: React.FC; } import { i18n } from '@kbn/i18n'; diff --git a/x-pack/legacy/plugins/security/public/components/authentication_state_page/authentication_state_page.tsx b/x-pack/legacy/plugins/security/public/components/authentication_state_page/authentication_state_page.tsx index 2e02275b39611..aa30661129978 100644 --- a/x-pack/legacy/plugins/security/public/components/authentication_state_page/authentication_state_page.tsx +++ b/x-pack/legacy/plugins/security/public/components/authentication_state_page/authentication_state_page.tsx @@ -11,7 +11,7 @@ interface Props { title: React.ReactNode; } -export const AuthenticationStatePage: React.SFC = props => ( +export const AuthenticationStatePage: React.FC = props => (
diff --git a/x-pack/legacy/plugins/security/public/views/account/components/account_management_page.tsx b/x-pack/legacy/plugins/security/public/views/account/components/account_management_page.tsx index 94a42166fbb9e..2ed057ad73a12 100644 --- a/x-pack/legacy/plugins/security/public/views/account/components/account_management_page.tsx +++ b/x-pack/legacy/plugins/security/public/views/account/components/account_management_page.tsx @@ -13,7 +13,7 @@ interface Props { user: AuthenticatedUser; } -export const AccountManagementPage: React.SFC = props => ( +export const AccountManagementPage: React.FC = props => ( diff --git a/x-pack/legacy/plugins/security/public/views/login/components/disabled_login_form/disabled_login_form.tsx b/x-pack/legacy/plugins/security/public/views/login/components/disabled_login_form/disabled_login_form.tsx index 012c16c57716e..b539029d834ec 100644 --- a/x-pack/legacy/plugins/security/public/views/login/components/disabled_login_form/disabled_login_form.tsx +++ b/x-pack/legacy/plugins/security/public/views/login/components/disabled_login_form/disabled_login_form.tsx @@ -12,7 +12,7 @@ interface Props { message: ReactNode; } -export const DisabledLoginForm: React.SFC = props => ( +export const DisabledLoginForm: React.FC = props => (

{props.title}

diff --git a/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_display.tsx b/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_display.tsx index a354155fcfb0a..6af7672f6fef8 100644 --- a/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_display.tsx +++ b/x-pack/legacy/plugins/security/public/views/management/edit_role/components/privileges/kibana/space_aware_privilege_section/privilege_display.tsx @@ -6,7 +6,7 @@ import { EuiIcon, EuiIconTip, EuiText, IconType, PropsOf, EuiToolTip } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import _ from 'lodash'; -import React, { ReactNode, SFC } from 'react'; +import React, { ReactNode, FC } from 'react'; import { PRIVILEGE_SOURCE, PrivilegeExplanation, @@ -21,7 +21,7 @@ interface Props extends PropsOf { tooltipContent?: ReactNode; } -export const PrivilegeDisplay: SFC = (props: Props) => { +export const PrivilegeDisplay: FC = (props: Props) => { const { explanation } = props; if (!explanation) { @@ -39,7 +39,7 @@ export const PrivilegeDisplay: SFC = (props: Props) => { return ; }; -const SimplePrivilegeDisplay: SFC = (props: Props) => { +const SimplePrivilegeDisplay: FC = (props: Props) => { const { privilege, iconType, iconTooltipContent, explanation, tooltipContent, ...rest } = props; const text = ( @@ -55,7 +55,7 @@ const SimplePrivilegeDisplay: SFC = (props: Props) => { return text; }; -export const SupersededPrivilegeDisplay: SFC = (props: Props) => { +export const SupersededPrivilegeDisplay: FC = (props: Props) => { const { supersededPrivilege, actualPrivilegeSource } = props.explanation || ({} as PrivilegeExplanation); @@ -77,7 +77,7 @@ export const SupersededPrivilegeDisplay: SFC = (props: Props) => { ); }; -export const EffectivePrivilegeDisplay: SFC = (props: Props) => { +export const EffectivePrivilegeDisplay: FC = (props: Props) => { const { explanation, ...rest } = props; const source = getReadablePrivilegeSource(explanation!.actualPrivilegeSource); diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/components/data_placeholder.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/components/data_placeholder.tsx index 5908a34a67d73..92e82e6800226 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/components/data_placeholder.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/components/data_placeholder.tsx @@ -13,7 +13,7 @@ interface Props { children: React.ReactNode; } -export const DataPlaceholder: React.SFC = ({ data, children }) => { +export const DataPlaceholder: React.FC = ({ data, children }) => { const { core: { i18n }, } = useAppDependencies(); diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/components/repository_type_logo.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/components/repository_type_logo.tsx index 9ce6eabf66b7c..881d03deaf4f9 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/components/repository_type_logo.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/components/repository_type_logo.tsx @@ -14,7 +14,7 @@ interface Props { [key: string]: any; } -export const RepositoryTypeLogo: React.SFC = ({ type, ...rest }) => { +export const RepositoryTypeLogo: React.FC = ({ type, ...rest }) => { const typeLogoMap: { [key: string]: any } = { [REPOSITORY_TYPES.fs]: 'storage', [REPOSITORY_TYPES.url]: 'eye', diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/snapshot_state.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/snapshot_state.tsx index 07fe0a58138f3..b14e5c1a81424 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/snapshot_state.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/snapshot_state.tsx @@ -15,7 +15,7 @@ interface Props { state: any; } -export const SnapshotState: React.SFC = ({ state }) => { +export const SnapshotState: React.FC = ({ state }) => { const { core: { i18n }, } = useAppDependencies(); diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx index ea2b8b9904d8f..eab31bae7df24 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_failures.tsx @@ -16,7 +16,7 @@ interface Props { snapshotState: string; } -export const TabFailures: React.SFC = ({ indexFailures, snapshotState }) => { +export const TabFailures: React.FC = ({ indexFailures, snapshotState }) => { const { core: { i18n: { FormattedMessage }, diff --git a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx index bbec23d30622d..d3d32cb149064 100644 --- a/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx +++ b/x-pack/legacy/plugins/snapshot_restore/public/app/sections/home/snapshot_list/snapshot_details/tabs/tab_summary.tsx @@ -30,7 +30,7 @@ interface Props { snapshotDetails: SnapshotDetails; } -export const TabSummary: React.SFC = ({ snapshotDetails }) => { +export const TabSummary: React.FC = ({ snapshotDetails }) => { const { core: { i18n: { FormattedMessage }, diff --git a/x-pack/legacy/plugins/spaces/public/components/space_avatar.tsx b/x-pack/legacy/plugins/spaces/public/components/space_avatar.tsx index 0211fe7e82643..0d9751ca43db9 100644 --- a/x-pack/legacy/plugins/spaces/public/components/space_avatar.tsx +++ b/x-pack/legacy/plugins/spaces/public/components/space_avatar.tsx @@ -5,7 +5,7 @@ */ import { EuiAvatar, isValidHex } from '@elastic/eui'; -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import { MAX_SPACE_INITIALS } from '../../common'; import { Space } from '../../common/model/space'; import { getSpaceColor, getSpaceInitials, getSpaceImageUrl } from '../lib/space_attributes'; @@ -17,7 +17,7 @@ interface Props { announceSpaceName?: boolean; } -export const SpaceAvatar: SFC = (props: Props) => { +export const SpaceAvatar: FC = (props: Props) => { const { space, size, announceSpaceName, ...rest } = props; const spaceName = space.name ? space.name.trim() : ''; diff --git a/x-pack/legacy/plugins/spaces/public/views/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.tsx b/x-pack/legacy/plugins/spaces/public/views/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.tsx index d75b8abbe592e..53c8be7163341 100644 --- a/x-pack/legacy/plugins/spaces/public/views/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.tsx +++ b/x-pack/legacy/plugins/spaces/public/views/management/edit_space/confirm_alter_active_space_modal/confirm_alter_active_space_modal.tsx @@ -14,7 +14,7 @@ interface Props { intl: InjectedIntl; } -const ConfirmAlterActiveSpaceModalUI: React.SFC = props => ( +const ConfirmAlterActiveSpaceModalUI: React.FC = props => ( void; } -export const SpacesDescription: SFC = (props: Props) => { +export const SpacesDescription: FC = (props: Props) => { const panelProps = { className: 'spcDescription', title: 'Spaces', diff --git a/x-pack/legacy/plugins/spaces/public/views/nav_control/components/spaces_header_nav_button.tsx b/x-pack/legacy/plugins/spaces/public/views/nav_control/components/spaces_header_nav_button.tsx index 2fa0f8ca605b0..d5c693df58b28 100644 --- a/x-pack/legacy/plugins/spaces/public/views/nav_control/components/spaces_header_nav_button.tsx +++ b/x-pack/legacy/plugins/spaces/public/views/nav_control/components/spaces_header_nav_button.tsx @@ -11,7 +11,7 @@ import { import React from 'react'; import { ButtonProps } from '../types'; -export const SpacesHeaderNavButton: React.SFC = props => ( +export const SpacesHeaderNavButton: React.FC = props => ( = ({ +export const DropDown: React.FC = ({ changeHandler, options, placeholder = 'Search ...', diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/agg_label_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/agg_label_form.tsx index 89f734f9bf268..cf3cd24c0439c 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/agg_label_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/agg_label_form.tsx @@ -22,7 +22,7 @@ interface Props { onChange(item: PivotAggsConfig): void; } -export const AggLabelForm: React.SFC = ({ +export const AggLabelForm: React.FC = ({ deleteHandler, item, otherAggNames, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_form.tsx index b9437fee89efd..f3537dd7a523c 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_form.tsx @@ -24,12 +24,7 @@ export interface AggListProps { onChange(previousAggName: AggName, item: PivotAggsConfig): void; } -export const AggListForm: React.SFC = ({ - deleteHandler, - list, - onChange, - options, -}) => { +export const AggListForm: React.FC = ({ deleteHandler, list, onChange, options }) => { const listKeys = Object.keys(list); return ( diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_summary.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_summary.tsx index 2b781e3a6c64d..7d07d79e7d283 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_summary.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/list_summary.tsx @@ -14,7 +14,7 @@ export interface AggListSummaryProps { list: PivotAggsConfigDict; } -export const AggListSummary: React.SFC = ({ list }) => { +export const AggListSummary: React.FC = ({ list }) => { const aggNames = Object.keys(list); return ( diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx index 65dd8a34330a5..6c1e119ab38e0 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/aggregation_list/popover_form.tsx @@ -40,12 +40,7 @@ interface Props { onChange(d: PivotAggsConfig): void; } -export const PopoverForm: React.SFC = ({ - defaultData, - otherAggNames, - onChange, - options, -}) => { +export const PopoverForm: React.FC = ({ defaultData, otherAggNames, onChange, options }) => { const isUnsupportedAgg = !isPivotAggsConfigWithUiSupport(defaultData); const [aggName, setAggName] = useState(defaultData.aggName); diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_form.tsx index d03c828e68fe2..c79da06ac8080 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_form.tsx @@ -28,7 +28,7 @@ interface Props { onChange(item: PivotGroupByConfig): void; } -export const GroupByLabelForm: React.SFC = ({ +export const GroupByLabelForm: React.FC = ({ deleteHandler, item, otherAggNames, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_summary.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_summary.tsx index 511eb091c6d42..1249ba50f2cc1 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_summary.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/group_by_label_summary.tsx @@ -15,7 +15,7 @@ interface Props { optionsDataId: string; } -export const GroupByLabelSummary: React.SFC = ({ item, optionsDataId }) => { +export const GroupByLabelSummary: React.FC = ({ item, optionsDataId }) => { let interval: string | undefined; if (isGroupByDateHistogram(item)) { diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_form.tsx index 484314df5067d..c6f11a96cdfd4 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_form.tsx @@ -24,7 +24,7 @@ interface ListProps { onChange(id: string, item: PivotGroupByConfig): void; } -export const GroupByListForm: React.SFC = ({ +export const GroupByListForm: React.FC = ({ deleteHandler, list, onChange, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_summary.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_summary.tsx index 46251e552e098..fc3c4b92c2a60 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_summary.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/list_summary.tsx @@ -16,7 +16,7 @@ interface ListProps { list: PivotGroupByConfigDict; } -export const GroupByListSummary: React.SFC = ({ list }) => { +export const GroupByListSummary: React.FC = ({ list }) => { const listKeys = Object.keys(list); return ( diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/popover_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/popover_form.tsx index e5ee72c0708ac..d05cf30f1d743 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/popover_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/group_by_list/popover_form.tsx @@ -92,12 +92,7 @@ interface Props { onChange(item: PivotGroupByConfig): void; } -export const PopoverForm: React.SFC = ({ - defaultData, - otherAggNames, - onChange, - options, -}) => { +export const PopoverForm: React.FC = ({ defaultData, otherAggNames, onChange, options }) => { const isUnsupportedAgg = !isPivotGroupByConfigWithUiSupport(defaultData); const [agg, setAgg] = useState(defaultData.agg); diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/expanded_row.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/expanded_row.tsx index c69d051348654..9b83a3e5da8a8 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/expanded_row.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/expanded_row.tsx @@ -10,7 +10,7 @@ import { EuiBadge, EuiText } from '@elastic/eui'; import { EsDoc } from '../../../../common'; -export const ExpandedRow: React.SFC<{ item: EsDoc }> = ({ item }) => ( +export const ExpandedRow: React.FC<{ item: EsDoc }> = ({ item }) => ( {Object.entries(item._source).map(([k, value]) => ( diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx index 8c870cc83636d..289ea62a57ab1 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/source_index_preview.tsx @@ -61,7 +61,7 @@ const CELL_CLICK_ENABLED = false; interface SourceIndexPreviewTitle { indexPatternTitle: string; } -const SourceIndexPreviewTitle: React.SFC = ({ indexPatternTitle }) => ( +const SourceIndexPreviewTitle: React.FC = ({ indexPatternTitle }) => ( {i18n.translate('xpack.transform.sourceIndexPreview.sourceIndexPatternTitle', { @@ -77,7 +77,7 @@ interface Props { cellClick?(search: string): void; } -export const SourceIndexPreview: React.SFC = React.memo(({ cellClick, query }) => { +export const SourceIndexPreview: React.FC = React.memo(({ cellClick, query }) => { const [clearTable, setClearTable] = useState(false); const indexPattern = useCurrentIndexPattern(); diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/use_source_index_data.test.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/use_source_index_data.test.tsx index 3bfe6c2cd0c5f..fb0a71baea321 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/use_source_index_data.test.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/source_index_preview/use_source_index_data.test.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import ReactDOM from 'react-dom'; import { act } from 'react-dom/test-utils'; @@ -22,7 +22,7 @@ interface TestHookProps { callback: Callback; } -const TestHook: SFC = ({ callback }) => { +const TestHook: FC = ({ callback }) => { callback(); return null; }; diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx index 05b68631b7856..9ab3edbe8ad6b 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_form.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, SFC, useContext, useEffect, useState } from 'react'; +import React, { Fragment, FC, useContext, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { toastNotifications } from 'ui/notify'; @@ -60,7 +60,7 @@ interface Props { onChange(s: StepDetailsExposedState): void; } -export const StepCreateForm: SFC = React.memo( +export const StepCreateForm: FC = React.memo( ({ createIndexPattern, transformConfig, transformId, onChange, overrides }) => { const defaults = { ...getDefaultStepCreateState(), ...overrides }; diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_summary.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_summary.tsx index 1790b945df9cd..ebce5fe667f1e 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_summary.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_create/step_create_summary.tsx @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC } from 'react'; +import React, { FC } from 'react'; -export const StepCreateSummary: SFC = React.memo(() => { +export const StepCreateSummary: FC = React.memo(() => { return null; }); diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx index 681a0f7e6ba3f..ad7ef04c39760 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/pivot_preview.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC, useEffect, useRef, useState } from 'react'; +import React, { FC, useEffect, useRef, useState } from 'react'; import moment from 'moment-timezone'; import { i18n } from '@kbn/i18n'; @@ -68,7 +68,7 @@ interface PreviewTitleProps { previewRequest: PreviewRequestBody; } -const PreviewTitle: SFC = ({ previewRequest }) => { +const PreviewTitle: FC = ({ previewRequest }) => { const euiCopyText = i18n.translate('xpack.transform.pivotPreview.copyClipboardTooltip', { defaultMessage: 'Copy Dev Console statement of the pivot preview to the clipboard.', }); @@ -102,7 +102,7 @@ interface ErrorMessageProps { message: string; } -const ErrorMessage: SFC = ({ message }) => ( +const ErrorMessage: FC = ({ message }) => ( {message} @@ -114,7 +114,7 @@ interface PivotPreviewProps { query: PivotQuery; } -export const PivotPreview: SFC = React.memo(({ aggs, groupBy, query }) => { +export const PivotPreview: FC = React.memo(({ aggs, groupBy, query }) => { const [clearTable, setClearTable] = useState(false); const indexPattern = useCurrentIndexPattern(); diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx index 8eea3b020dcfe..ebb0660cac55f 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/step_define_form.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, SFC, useContext, useEffect, useState } from 'react'; +import React, { Fragment, FC, useContext, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; @@ -195,7 +195,7 @@ interface Props { onChange(s: StepDefineExposedState): void; } -export const StepDefineForm: SFC = React.memo(({ overrides = {}, onChange }) => { +export const StepDefineForm: FC = React.memo(({ overrides = {}, onChange }) => { const kibanaContext = useContext(KibanaContext); const defaults = { ...getDefaultStepDefineState(kibanaContext), ...overrides }; diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/use_pivot_preview_data.test.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/use_pivot_preview_data.test.tsx index 0843dfc306f85..824ff0462cbba 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/use_pivot_preview_data.test.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_define/use_pivot_preview_data.test.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import ReactDOM from 'react-dom'; import { SimpleQuery } from '../../../../common'; @@ -23,7 +23,7 @@ interface TestHookProps { callback: Callback; } -const TestHook: SFC = ({ callback }) => { +const TestHook: FC = ({ callback }) => { callback(); return null; }; diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx index aa917ca3b05ec..ef6159a1f7bb0 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, SFC, useContext, useEffect, useState } from 'react'; +import React, { Fragment, FC, useContext, useEffect, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { metadata } from 'ui/metadata'; @@ -54,7 +54,7 @@ interface Props { onChange(s: StepDetailsExposedState): void; } -export const StepDetailsForm: SFC = React.memo(({ overrides = {}, onChange }) => { +export const StepDetailsForm: FC = React.memo(({ overrides = {}, onChange }) => { const kibanaContext = useContext(KibanaContext); const defaults = { ...getDefaultStepDetailsState(), ...overrides }; diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx index ddb34dfa3f87d..7d4d25c1d05cf 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_summary.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; @@ -12,7 +12,7 @@ import { EuiFieldText, EuiFormRow } from '@elastic/eui'; import { StepDetailsExposedState } from './step_details_form'; -export const StepDetailsSummary: SFC = React.memo( +export const StepDetailsSummary: FC = React.memo( ({ continuousModeDateField, createIndexPattern, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx index d5b32fc7f05af..25d3915a1eae9 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard/wizard.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, SFC, useContext, useEffect, useRef, useState } from 'react'; +import React, { Fragment, FC, useContext, useEffect, useRef, useState } from 'react'; import { i18n } from '@kbn/i18n'; @@ -42,7 +42,7 @@ interface DefinePivotStepProps { setStepDefineState: React.Dispatch>; } -const StepDefine: SFC = ({ +const StepDefine: FC = ({ isCurrentStep, stepDefineState, setCurrentStep, @@ -67,7 +67,7 @@ const StepDefine: SFC = ({ ); }; -export const Wizard: SFC = React.memo(() => { +export const Wizard: FC = React.memo(() => { const kibanaContext = useContext(KibanaContext); // The current WIZARD_STEP diff --git a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard_nav/wizard_nav.tsx b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard_nav/wizard_nav.tsx index bfdfcbf696d35..35ca789f4daaf 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard_nav/wizard_nav.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/create_transform/components/wizard_nav/wizard_nav.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import { i18n } from '@kbn/i18n'; @@ -17,7 +17,7 @@ interface StepsNavProps { next?(): void; } -export const WizardNav: SFC = ({ +export const WizardNav: FC = ({ previous, previousActive = true, next, diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx index 24d09c899580e..687bb0df3f577 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import { EuiTabbedContent } from '@elastic/eui'; @@ -35,7 +35,7 @@ interface Props { item: TransformListRow; } -export const ExpandedRow: SFC = ({ item }) => { +export const ExpandedRow: FC = ({ item }) => { const stateValues = { ...item.stats }; delete stateValues.stats; delete stateValues.checkpointing; diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_details_pane.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_details_pane.tsx index 7ba05a5fe41ec..cae95286c464d 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_details_pane.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_details_pane.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, SFC } from 'react'; +import React, { Fragment, FC } from 'react'; import { EuiDescriptionList, @@ -29,7 +29,7 @@ interface SectionProps { section: SectionConfig; } -export const Section: SFC = ({ section }) => { +export const Section: FC = ({ section }) => { if (section.items.length === 0) { return null; } @@ -48,7 +48,7 @@ interface ExpandedRowDetailsPaneProps { sections: SectionConfig[]; } -export const ExpandedRowDetailsPane: SFC = ({ sections }) => { +export const ExpandedRowDetailsPane: FC = ({ sections }) => { return ( diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx index 416d93007daba..ac7fdcb129531 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_json_pane.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { SFC } from 'react'; +import React, { FC } from 'react'; import { // @ts-ignore @@ -18,7 +18,7 @@ interface Props { json: object; } -export const ExpandedRowJsonPane: SFC = ({ json }) => { +export const ExpandedRowJsonPane: FC = ({ json }) => { return ( diff --git a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx index 526152a829963..3f0a9a410f17e 100644 --- a/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx +++ b/x-pack/legacy/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row_messages_pane.tsx @@ -22,7 +22,7 @@ interface Props { transformId: string; } -export const ExpandedRowMessagesPane: React.SFC = ({ transformId }) => { +export const ExpandedRowMessagesPane: React.FC = ({ transformId }) => { const [messages, setMessages] = useState([]); const [isLoading, setIsLoading] = useState(false); const [errorMessage, setErrorMessage] = useState(''); diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/app.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/app.tsx index 3bf3375c43bd9..b8ba85f0257a2 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/app.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/app.tsx @@ -12,7 +12,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { NEXT_MAJOR_VERSION } from '../common/version'; import { UpgradeAssistantTabs } from './components/tabs'; -export const RootComponent: React.StatelessComponent = () => ( +export const RootComponent: React.FunctionComponent = () => (
diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/error_banner.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/error_banner.tsx index 527f2b6486d7f..06cd5809c951a 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/error_banner.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/error_banner.tsx @@ -12,7 +12,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { UpgradeAssistantTabProps } from './types'; -export const LoadingErrorBanner: React.StatelessComponent> = ({ loadingError }) => { diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/latest_minor_banner.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/latest_minor_banner.tsx index 1f24377eba6cd..b76dcbd66b24a 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/latest_minor_banner.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/latest_minor_banner.tsx @@ -11,7 +11,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { CURRENT_MAJOR_VERSION, NEXT_MAJOR_VERSION } from '../../common/version'; -export const LatestMinorBanner: React.StatelessComponent = () => ( +export const LatestMinorBanner: React.FunctionComponent = () => ( void; } -export const CheckupControlsUI: StatelessComponent = ({ +export const CheckupControlsUI: FunctionComponent = ({ allDeprecations, loadingState, loadData, diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/cell.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/cell.tsx index e8f2a19857cc8..6216324e32055 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/cell.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/cell.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { ReactNode, StatelessComponent } from 'react'; +import React, { ReactNode, FunctionComponent } from 'react'; import { EuiFlexGroup, @@ -33,7 +33,7 @@ interface DeprecationCellProps { /** * Used to display a deprecation with links to docs, a health indicator, and other descriptive information. */ -export const DeprecationCell: StatelessComponent = ({ +export const DeprecationCell: FunctionComponent = ({ headline, healthColor, indexName, diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/count_summary.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/count_summary.tsx index a66244b0e7886..e9ab6f3fe1848 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/count_summary.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/count_summary.tsx @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, StatelessComponent } from 'react'; +import React, { Fragment, FunctionComponent } from 'react'; import { EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { EnrichedDeprecationInfo } from '../../../../../server/lib/es_migration_apis'; -export const DeprecationCountSummary: StatelessComponent<{ +export const DeprecationCountSummary: FunctionComponent<{ deprecations: EnrichedDeprecationInfo[]; allDeprecations: EnrichedDeprecationInfo[]; }> = ({ deprecations, allDeprecations }) => ( diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/grouped.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/grouped.tsx index 9ce0b8a8cefd3..86a582ee58f69 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/grouped.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/grouped.tsx @@ -5,7 +5,7 @@ */ import { groupBy } from 'lodash'; -import React, { Fragment, StatelessComponent } from 'react'; +import React, { Fragment, FunctionComponent } from 'react'; import { EuiAccordion, @@ -59,7 +59,7 @@ export const filterDeps = (level: LevelFilterOption, search: string = '') => { /** * A single accordion item for a grouped deprecation item. */ -export const DeprecationAccordion: StatelessComponent<{ +export const DeprecationAccordion: FunctionComponent<{ id: string; deprecations: EnrichedDeprecationInfo[]; title: string; diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/health.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/health.tsx index ab4daece767a0..63c32e0026505 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/health.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/health.tsx @@ -5,7 +5,7 @@ */ import { countBy } from 'lodash'; -import React, { StatelessComponent } from 'react'; +import React, { FunctionComponent } from 'react'; import { EuiBadge, EuiToolTip } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -36,7 +36,7 @@ interface DeprecationHealthProps { single?: boolean; } -const SingleHealth: StatelessComponent<{ level: DeprecationInfo['level']; label: string }> = ({ +const SingleHealth: FunctionComponent<{ level: DeprecationInfo['level']; label: string }> = ({ level, label, }) => ( @@ -52,7 +52,7 @@ const SingleHealth: StatelessComponent<{ level: DeprecationInfo['level']; label: * Displays a summary health for a list of deprecations that shows the number and level of severity * deprecations in the list. */ -export const DeprecationHealth: StatelessComponent = ({ +export const DeprecationHealth: FunctionComponent = ({ deprecations, single = false, }) => { diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/list.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/list.tsx index 4affce26fc63b..59a67e6ea0673 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/list.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/list.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { StatelessComponent } from 'react'; +import React, { FunctionComponent } from 'react'; import { DeprecationInfo } from 'src/legacy/core_plugins/elasticsearch'; import { EnrichedDeprecationInfo } from '../../../../../server/lib/es_migration_apis'; @@ -21,7 +21,7 @@ const sortByLevelDesc = (a: DeprecationInfo, b: DeprecationInfo) => { /** * Used to show a single deprecation message with any detailed information. */ -const MessageDeprecation: StatelessComponent<{ deprecation: EnrichedDeprecationInfo }> = ({ +const MessageDeprecation: FunctionComponent<{ deprecation: EnrichedDeprecationInfo }> = ({ deprecation, }) => { const items = []; @@ -46,7 +46,7 @@ const MessageDeprecation: StatelessComponent<{ deprecation: EnrichedDeprecationI /** * Used to show a single (simple) deprecation message with any detailed information. */ -const SimpleMessageDeprecation: StatelessComponent<{ deprecation: EnrichedDeprecationInfo }> = ({ +const SimpleMessageDeprecation: FunctionComponent<{ deprecation: EnrichedDeprecationInfo }> = ({ deprecation, }) => { const items = []; @@ -66,7 +66,7 @@ interface IndexDeprecationProps { /** * Shows a single deprecation and table of affected indices with details for each index. */ -const IndexDeprecation: StatelessComponent = ({ deprecation, indices }) => { +const IndexDeprecation: FunctionComponent = ({ deprecation, indices }) => { return ( @@ -78,7 +78,7 @@ const IndexDeprecation: StatelessComponent = ({ deprecati * A list of deprecations that is either shown as individual deprecation cells or as a * deprecation summary for a list of indices. */ -export const DeprecationList: StatelessComponent<{ +export const DeprecationList: FunctionComponent<{ deprecations: EnrichedDeprecationInfo[]; currentGroupBy: GroupByOption; }> = ({ deprecations, currentGroupBy }) => { diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx index 42dfebfb0dfec..1d7d2672b51cf 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/checklist_step.tsx @@ -69,7 +69,7 @@ const buttonLabel = (status?: ReindexStatus) => { /** * Displays a flyout that shows the current reindexing status for a given index. */ -export const ChecklistFlyoutStep: React.StatelessComponent<{ +export const ChecklistFlyoutStep: React.FunctionComponent<{ closeFlyout: () => void; reindexState: ReindexState; startReindex: () => void; diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.tsx index 0510752b04e9a..4966f0be1b7e3 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/progress.tsx @@ -21,7 +21,7 @@ import { LoadingState } from '../../../../../types'; import { ReindexState } from '../polling_service'; import { StepProgress, StepProgressStep } from './step_progress'; -const ErrorCallout: React.StatelessComponent<{ errorMessage: string | null }> = ({ +const ErrorCallout: React.FunctionComponent<{ errorMessage: string | null }> = ({ errorMessage, }) => ( @@ -38,7 +38,7 @@ const PausedCallout = () => ( /> ); -const ReindexProgressBar: React.StatelessComponent<{ +const ReindexProgressBar: React.FunctionComponent<{ reindexState: ReindexState; cancelReindex: () => void; }> = ({ @@ -113,7 +113,7 @@ const orderedSteps = Object.values(ReindexStep).sort() as number[]; * Displays a list of steps in the reindex operation, the current status, a progress bar, * and any error messages that are encountered. */ -export const ReindexProgress: React.StatelessComponent<{ +export const ReindexProgress: React.FunctionComponent<{ reindexState: ReindexState; cancelReindex: () => void; }> = props => { diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/step_progress.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/step_progress.tsx index 78537b16cc9c6..8b0bb348941e0 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/step_progress.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/step_progress.tsx @@ -11,7 +11,7 @@ import { EuiIcon, EuiLoadingSpinner } from '@elastic/eui'; type STATUS = 'incomplete' | 'inProgress' | 'complete' | 'failed' | 'paused' | 'cancelled'; -const StepStatus: React.StatelessComponent<{ status: STATUS; idx: number }> = ({ status, idx }) => { +const StepStatus: React.FunctionComponent<{ status: STATUS; idx: number }> = ({ status, idx }) => { if (status === 'incomplete') { return {idx + 1}.; } else if (status === 'inProgress') { @@ -45,7 +45,7 @@ const StepStatus: React.StatelessComponent<{ status: STATUS; idx: number }> = ({ throw new Error(`Unsupported status: ${status}`); }; -const Step: React.StatelessComponent = ({ +const Step: React.FunctionComponent = ({ title, status, children, @@ -79,7 +79,7 @@ export interface StepProgressStep { /** * A generic component that displays a series of automated steps and the system's progress. */ -export const StepProgress: React.StatelessComponent<{ +export const StepProgress: React.FunctionComponent<{ steps: StepProgressStep[]; }> = ({ steps }) => { return ( diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx index 80dd773ac950e..5bdc280792600 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/deprecations/reindex/flyout/warnings_step.tsx @@ -29,7 +29,7 @@ interface CheckedIds { export const idForWarning = (warning: ReindexWarning) => `reindexWarning-${warning}`; -const WarningCheckbox: React.StatelessComponent<{ +const WarningCheckbox: React.FunctionComponent<{ checkedIds: CheckedIds; warning: ReindexWarning; label: React.ReactNode; diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/filter_bar.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/filter_bar.tsx index 0921b5e7e5cfa..de2527a493b91 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/filter_bar.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/filter_bar.tsx @@ -31,7 +31,7 @@ interface FilterBarProps { onFilterChange(level: LevelFilterOption): void; } -export const FilterBar: React.StatelessComponent = ({ +export const FilterBar: React.FunctionComponent = ({ allDeprecations = [], currentFilter, onFilterChange, diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/group_by_bar.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/group_by_bar.tsx index 6b1053faf6b6d..564236024372b 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/group_by_bar.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/checkup/group_by_bar.tsx @@ -26,7 +26,7 @@ interface GroupByBarProps { onGroupByChange: (groupBy: GroupByOption) => void; } -export const GroupByBar: React.StatelessComponent = ({ +export const GroupByBar: React.FunctionComponent = ({ availableGroupByOptions, currentGroupBy, onGroupByChange, diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/index.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/index.tsx index 834f5f4afe5f6..a96cb471309b2 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/index.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/index.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, StatelessComponent } from 'react'; +import React, { Fragment, FunctionComponent } from 'react'; import { EuiFlexGroup, @@ -24,7 +24,7 @@ import { LoadingErrorBanner } from '../../error_banner'; import { LoadingState, UpgradeAssistantTabProps } from '../../types'; import { Steps } from './steps'; -export const OverviewTab: StatelessComponent = props => ( +export const OverviewTab: FunctionComponent = props => ( diff --git a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/steps.tsx b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/steps.tsx index 3c1852992c8dc..fed9a1ebf967a 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/steps.tsx +++ b/x-pack/legacy/plugins/upgrade_assistant/public/components/tabs/overview/steps.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment, StatelessComponent } from 'react'; +import React, { Fragment, FunctionComponent } from 'react'; import { EuiFormRow, @@ -92,8 +92,11 @@ const START_UPGRADE_STEP = { ), }; -export const StepsUI: StatelessComponent = ({ checkupData, setSelectedTabIndex, intl }) => { +export const StepsUI: FunctionComponent = ({ + checkupData, + setSelectedTabIndex, + intl, +}) => { const checkupDataTyped = (checkupData! as unknown) as { [checkupType: string]: any[] }; const countByType = Object.keys(checkupDataTyped).reduce((counts, checkupType) => { counts[checkupType] = checkupDataTyped[checkupType].length; diff --git a/x-pack/typings/@elastic/eui/index.d.ts b/x-pack/typings/@elastic/eui/index.d.ts index 93d90ed43ff4b..de9697f859fd7 100644 --- a/x-pack/typings/@elastic/eui/index.d.ts +++ b/x-pack/typings/@elastic/eui/index.d.ts @@ -7,8 +7,8 @@ // TODO: Remove once typescript definitions are in EUI declare module '@elastic/eui' { - export const EuiDescribedFormGroup: React.SFC; - export const EuiCodeEditor: React.SFC; + export const EuiDescribedFormGroup: React.FC; + export const EuiCodeEditor: React.FC; export const Query: any; } diff --git a/yarn.lock b/yarn.lock index f7618766a1739..263f2a1fef52d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -22764,7 +22764,7 @@ react-docgen@^4.1.0: node-dir "^0.1.10" recast "^0.17.3" -react-dom@^16.2.0, react-dom@^16.8.0: +react-dom@^16.8.0: version "16.8.2" resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.2.tgz#7c8a69545dd554d45d66442230ba04a6a0a3c3d3" integrity sha512-cPGfgFfwi+VCZjk73buu14pYkYBR1b/SRMSYqkLDdhSEHnSwcuYTPu6/Bh6ZphJFIk80XLvbSe2azfcRzNF+Xg== @@ -23377,7 +23377,7 @@ react@^0.14.0: envify "^3.0.0" fbjs "^0.6.1" -react@^16.2.0, react@^16.6.0, react@^16.8.0: +react@^16.8.0: version "16.8.2" resolved "https://registry.yarnpkg.com/react/-/react-16.8.2.tgz#83064596feaa98d9c2857c4deae1848b542c9c0c" integrity sha512-aB2ctx9uQ9vo09HVknqv3DGRpI7OIGJhCx3Bt0QqoRluEjHSaObJl+nG12GDdYH6sTgE7YiPJ6ZUyMx9kICdXw==