I am using the same code. staff By clicking Sign up for GitHub, you agree to our terms of service and Unsure of that's correct what I'm saying You want to make your select controlled by providing value property from state. render() { In react-bootstrap@0.24.5 I've used Input attribute defaultValue to specify start value selected in combobox. awolfard :), I tried literally everything until I found your answer :). const newState=Object.assign({}, this.state);

Well occasionally send you account related emails. You signed in with another tab or window. I had this error with me when passing a String value to option.value and in select.defaultValue I passed a variable with the same string gave error. Which "href" value should I use for JavaScript links, "#" or "javascript:void(0)"? import React from "react"; , code with success: To get select elements value in react-bootstrap, we can set the onChange prop to a function that gets the selected value. If you are attempting to load an array of options into the Form-Control (By a network-call, promise or other async function) make sure you dont render the Select-field until the options-array has been fully loaded. Warning: Use the defaultValue or value props on instead of setting selected on . He actually asked for a default value not actual value. asked 4 years ago, Anna Morawska To handle this case, you can specify a defaultValue attribute instead of value. I had this issue and turns out the property was not getting down to the actual component. Or else the defaultValue wont work. How to Open a Component in New Window on a Click in React? How this should be handled in react-bootstrap@0.30.7 ( newest one ) where Input was deprecated and new component that should be used here FormControl doesn't provide such attribute?

A community for learning and developing web applications using React by Facebook. Likewise, and support defaultChecked, and