added name to textarea

This commit is contained in:
Sebastian Sdorra
2018-11-09 14:04:26 +01:00
parent 232e4fc072
commit 05cbffd8a4

View File

@@ -8,10 +8,11 @@ export type SelectItem = {
};
type Props = {
name?: string,
label?: string,
placeholder?: SelectItem[],
value?: string,
onChange: string => void,
onChange: (value: string, name?: string) => void,
helpText?: string
};
@@ -19,7 +20,7 @@ class Textarea extends React.Component<Props> {
field: ?HTMLTextAreaElement;
handleInput = (event: SyntheticInputEvent<HTMLTextAreaElement>) => {
this.props.onChange(event.target.value);
this.props.onChange(event.target.value, this.props.name);
};
render() {