Be explicit in supported input types (#42)

* Be explicit in supported input types

* label as React$Node
This commit is contained in:
Jaco Greeff 2018-05-12 10:42:13 +02:00 committed by GitHub
parent 14d10ef6af
commit b20a131b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,20 +10,22 @@ import SUIInput from 'semantic-ui-react/dist/es/elements/Input';
import Labelled from './Labelled';
type Input$Type = 'number' | 'password' | 'text';
type Props = BareProps & {
children?: React$Node,
defaultValue?: mixed,
isAction?: boolean,
isDisabled?: boolean,
isError?: boolean,
label?: string,
label?: React$Node,
max?: mixed,
min?: mixed,
name?: string,
// flowlint-next-line unclear-type:off
onChange: (value: any) => void,
placeholder?: string,
type?: string,
type?: Input$Type,
value?: mixed
};
@ -62,7 +64,6 @@ export default class Input extends React.PureComponent<Props> {
);
}
// eslint-disable-next-line no-unused-var
onChange = (event: SyntheticEvent<*>, { value }: SUIEvent): void => {
this.props.onChange(value);
}