Add correct types for Input and Select components

[MAILPOET-2772]
This commit is contained in:
Ján Mikláš
2020-05-07 11:55:50 +02:00
committed by Veljko V
parent 6ef2467342
commit 064fccd541
2 changed files with 4 additions and 6 deletions

View File

@@ -1,12 +1,11 @@
import React from 'react'; import React, { InputHTMLAttributes } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
type Props = { type Props = InputHTMLAttributes<HTMLInputElement> & {
dimension?: 'small', dimension?: 'small',
isFullWidth?: boolean, isFullWidth?: boolean,
iconStart?: JSX.Element, iconStart?: JSX.Element,
iconEnd?: JSX.Element, iconEnd?: JSX.Element,
[attribute: string]: any, // any HTML attributes, e.g. type, name, id, placeholder
}; };
const Input = ({ const Input = ({

View File

@@ -1,12 +1,11 @@
import React from 'react'; import React, { SelectHTMLAttributes } from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
type Props = { type Props = SelectHTMLAttributes<HTMLSelectElement> & {
children?: React.ReactNode, children?: React.ReactNode,
dimension?: 'small', dimension?: 'small',
isFullWidth?: boolean, isFullWidth?: boolean,
iconStart?: JSX.Element, iconStart?: JSX.Element,
[attribute: string]: any, // any HTML attributes, e.g. name, id
}; };
const Select = ({ const Select = ({