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>
)
})
如何是否符合你建議的解決方案 –