You can start with these two functions. The first will create your choices dynamically based on the props passed to the page. If they are mapped to state, then the selection will be recreated.
createSelectItems() { let items = []; for (let i = 0; i <= this.props.maxValue; i++) { items.push(<option key={i} value={i}>{i}</option>);
Then you will have this block of code inside the rendering. You will pass the function reference to onChange prop, and each time the Change is called the selected object, it is automatically associated with this function. Instead of manually writing your parameters, you simply call the createSelectItems () function, which will build and return your parameters based on some restrictions (which may change).
<Input type="select" onChange={this.onDropdownSelected} label="Multiple Select" multiple> {this.createSelectItems()} </Input>
Theo
source share