I was using react-bootstrap library and I wanted to have default selected value.
I went through their docs and I wasn't able to find anything related to pass/set default value.
This is how I am currently using
const dropDownQuestion = (props) => {
const { options, upsideEmit, value } = props
return (
<DropdownButton
id="dropdown-basic-button"
onSelect={(eventKey) => upsideEmit(eventKey)}
>
{options.map((element) => (
<Dropdown.Item key={element.id}>{element.value}</Dropdown.Item>
))}
</DropdownButton>
)
}
Where value happens to be optional default Value. Can someone help me how to achieve this with react-bootstrap dropdown?