Chore: replace React.FC<Props> with simple function component (#54123)

This commit is contained in:
Ryan McKinley
2022-08-24 16:54:34 -04:00
committed by GitHub
parent 277ea836b6
commit b483ac322f
53 changed files with 63 additions and 76 deletions
@@ -10,7 +10,7 @@ type Props = {
style?: React.CSSProperties;
};
export const CloseButton: React.FC<Props> = ({ onClick, 'aria-label': ariaLabel, style }) => {
export const CloseButton = ({ onClick, 'aria-label': ariaLabel, style }: Props) => {
const styles = useStyles2(getStyles);
return (
<IconButton aria-label={ariaLabel ?? 'Close'} className={styles} name="times" onClick={onClick} style={style} />
@@ -7,7 +7,7 @@ interface Props extends StandardEditorProps<string, StringFieldConfigSettings> {
suffix?: ReactNode;
}
export const StringValueEditor: React.FC<Props> = ({ value, onChange, item, suffix }) => {
export const StringValueEditor = ({ value, onChange, item, suffix }: Props) => {
const Component = item.settings?.useTextarea ? TextArea : Input;
const onValueChange = useCallback(
(e: React.SyntheticEvent) => {
@@ -9,7 +9,7 @@ const LOCAL_STORAGE_KEY = 'grafana.dashboard.timepicker.history';
interface Props extends Omit<TimeRangePickerProps, 'history' | 'theme'> {}
export const TimePickerWithHistory: React.FC<Props> = (props) => {
export const TimePickerWithHistory = (props: Props) => {
return (
<LocalStorageValueProvider<TimeRange[]> storageKey={LOCAL_STORAGE_KEY} defaultValue={[]}>
{(values, onSaveToStore) => {