The onSelect function onSelect passed by the selected value.
<DropdownButton title='Dropdowna' onSelect={function(evt){console.log(evt)}}> <MenuItem eventKey='abc'>Dropdown link</MenuItem> <MenuItem eventKey={['a', 'b']}>Dropdown link</MenuItem> </DropdownButton>
In this case, if you select the first option, "abc" will be printed, in the second option you can see that the object can also be transferred.
So in your code
handleSelect: function (evt) {
I am not sure what you mean by default, since this is not a choice - the button text is what is in the title attribute. If you want to handle the default value, you can simply set the value when null .
noveyak
source share