Skip to content

Commit

Permalink
Eui prefers FunctionComponent over FC
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitropoulos committed Mar 1, 2020
1 parent 81bd676 commit a496fcc
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
9 changes: 7 additions & 2 deletions src/components/date_picker/date_picker_range.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import React, { cloneElement, Fragment, FC, ReactElement } from 'react';
import React, {
cloneElement,
Fragment,
FunctionComponent,
ReactElement,
} from 'react';
import classNames from 'classnames';

import { EuiText } from '../text';
Expand Down Expand Up @@ -30,7 +35,7 @@ export type EuiDatePickerRangeProps = CommonProps & {
startDateControl: ReactElement<EuiDatePickerProps>;
};

export const EuiDatePickerRange: FC<EuiDatePickerRangeProps> = ({
export const EuiDatePickerRange: FunctionComponent<EuiDatePickerRangeProps> = ({
children,
className,
startDateControl,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import React, { FC, ButtonHTMLAttributes, MouseEventHandler } from 'react';
import React, {
FunctionComponent,
ButtonHTMLAttributes,
MouseEventHandler,
} from 'react';
import classNames from 'classnames';

import { EuiPopover, EuiPopoverProps } from '../../../popover';
Expand Down Expand Up @@ -28,7 +32,9 @@ export interface EuiDatePopoverButtonProps {
value: string;
}

export const EuiDatePopoverButton: FC<EuiDatePopoverButtonProps> = props => {
export const EuiDatePopoverButton: FunctionComponent<
EuiDatePopoverButtonProps
> = props => {
const {
position,
isDisabled,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import React, { FunctionComponent } from 'react';

import { EuiTabbedContent, EuiTabbedContentProps } from '../../../tabs';
import { EuiText } from '../../../text';
Expand Down Expand Up @@ -26,7 +26,9 @@ export interface EuiDatePopoverContentProps {
position: 'start' | 'end';
}

export const EuiDatePopoverContent: FC<EuiDatePopoverContentProps> = ({
export const EuiDatePopoverContent: FunctionComponent<
EuiDatePopoverContentProps
> = ({
value,
roundUp = false,
onChange,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import React, { FunctionComponent } from 'react';
import { EuiI18n } from '../../../i18n';
import { EuiFlexGrid, EuiFlexItem } from '../../../flex';
import { EuiTitle } from '../../../title';
Expand All @@ -14,10 +14,9 @@ export interface EuiCommonlyUsedTimeRangesProps {
commonlyUsedRanges: DurationRange[];
}

export const EuiCommonlyUsedTimeRanges: FC<EuiCommonlyUsedTimeRangesProps> = ({
applyTime,
commonlyUsedRanges,
}) => {
export const EuiCommonlyUsedTimeRanges: FunctionComponent<
EuiCommonlyUsedTimeRangesProps
> = ({ applyTime, commonlyUsedRanges }) => {
const legendId = generateId();
const links = commonlyUsedRanges.map(({ start, end, label }) => {
const applyCommonlyUsed = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Fragment, FC } from 'react';
import React, { Fragment, FunctionComponent } from 'react';
import { prettyDuration } from '../pretty_duration';

import { EuiFlexGroup, EuiFlexItem } from '../../../flex';
Expand All @@ -16,7 +16,7 @@ export interface EuiRecentlyUsedProps {
recentlyUsedRanges?: DurationRange[];
}

export const EuiRecentlyUsed: FC<EuiRecentlyUsedProps> = ({
export const EuiRecentlyUsed: FunctionComponent<EuiRecentlyUsedProps> = ({
applyTime,
commonlyUsedRanges,
dateFormat,
Expand Down

0 comments on commit a496fcc

Please sign in to comment.