Recently I had a select input, but with a two-way binding to my input fields.The select input has the values of the input fields as it's options. With semantic UI, I need to use an array. How do I update the array state so I can select my inputs in the Dropdown?
I currently have the following code:
this.state = {
options: []
};
onChange(e) {
var arrayvar = this.state.options.slice();
arrayvar.push({ name: e.target.name, value: e.target.value });
this.setState({ options: arrayvar });
}
//Input example
<Input
type="text"
placeholder="Answer 3"
name="answer3"
onChange={this.onChange}
required
/>