I am using Form.Control to create a drop down list and I would like to make the list dynamic. My code looks like this:
render() {
return (
<Form.Control as="select" value={this.state.inputval} onChange={this.updateinputval}>
<option value={myArray[0].value}> myArray[0].value </option>
<option value={myArray[1].value}> myArray[1].value </option>
</Form.Control>
)
}
Obviously this only works when myArray has two elements. I would like to find a way to pass myArray into the options of 'Form.Control' dynamically. I have found answers in here on how to do it with Select but it does not seem to work with Form.Control as ="select" as I have here.
Thank you