From 93212342dac2f216be0f6452e01501bb09e7b800 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 11 Feb 2019 12:28:03 +0100 Subject: [PATCH] fix form input props flow --- src/components/atoms/Form/Input.tsx | 78 +++++++++++------------------ 1 file changed, 29 insertions(+), 49 deletions(-) diff --git a/src/components/atoms/Form/Input.tsx b/src/components/atoms/Form/Input.tsx index 6ed0688..bb2dd28 100644 --- a/src/components/atoms/Form/Input.tsx +++ b/src/components/atoms/Form/Input.tsx @@ -47,47 +47,46 @@ export default class Input extends PureComponent { this.setState({ isFocused: !this.state.isFocused }) } - public InputComponent = ({ ...props }) => { - if (props.type === 'select') { + public InputComponent = () => { + const { type, options, group, name } = this.props + + if (type === 'select') { return (
- - {props.options && - props.options.map( - (option: string, index: number) => ( - - ) - )} + {options && + options.map((option: string, index: number) => ( + + ))}
) - } else if (props.type === 'textarea') { + } else if (type === 'textarea') { return (
-