我正在尝试更改下拉组件中的 onChange 状态
const DropdownDomainSelection = () => (
<Dropdown placeholder='Select Friend' selection options={domainsList} onChange={this.handleDomainsSelectChange} />
)
handleDomainsSelectChange = (e, data) => {
this.setState({
currantDomain_id: data.value,
currantWidget_id: "null",
}, () => {
console.log('this.state.currantDomain_id',this.state.currantDomain_id);
});
}
状态变化很好。问题是下拉菜单的值总是返回到默认的“选择朋友”。
如何使下拉菜单将其状态更改为选定项目?