From b20a131b153373b342c34f901329bc1ec56e3fe6 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sat, 12 May 2018 10:42:13 +0200 Subject: [PATCH] Be explicit in supported input types (#42) * Be explicit in supported input types * label as React$Node --- packages/ui-app/src/Input.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ui-app/src/Input.js b/packages/ui-app/src/Input.js index 5c0ddb01c3..7278a3a296 100644 --- a/packages/ui-app/src/Input.js +++ b/packages/ui-app/src/Input.js @@ -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 { ); } - // eslint-disable-next-line no-unused-var onChange = (event: SyntheticEvent<*>, { value }: SUIEvent): void => { this.props.onChange(value); }