0
我想更改<DropdownButton>
标题选择项目时。 的事情是,我不能使用状态的Cuz,下拉标题心不是一个静态的“名” 看到例如:react-bootstrap更改DropdownButton标题不通过使用状态
this.props.itemToFltr.keys.map((key /* initial name to button */)=>{
return (
<DropdownButton id="dropdownBtn" bsSize="xsmall" title={key}
onSelect={(evt,name)=>{ /* can i change the title from here ? */ } } >
{this.props.itemToFltr[key].map((val)=>{
return <MenuItem eventKey={val} >{val} </MenuItem>
})}
</DropdownButton>
)
})
如何是否符合你建议的解决方案 –