Reactjs 试图覆盖react select中的MultiValueContainer,但它未接收选项数据
我试图覆盖多值容器,以便可以选择在多值标签旁边显示一个图标。我已经用MultiValueLabel组件尝试过了,但是文档表明它没有收到选项值,但是MultiValueContainer收到了Reactjs 试图覆盖react select中的MultiValueContainer,但它未接收选项数据,reactjs,react-select,Reactjs,React Select,我试图覆盖多值容器,以便可以选择在多值标签旁边显示一个图标。我已经用MultiValueLabel组件尝试过了,但是文档表明它没有收到选项值,但是MultiValueContainer收到了 <CreatableSelect components={MultiValueContainer: CustomMultiValueContainer} ... const CustomMultiValueContainer = (props) => { return (
<CreatableSelect
components={MultiValueContainer: CustomMultiValueContainer}
...
const CustomMultiValueContainer = (props) => {
return (
<components.MultiValueContainer {...props}>
{ props.option.showIcon &&
<i class="user-icon" >
}
{props.children}
</components.MultiValueContainer>
)
}
{
返回(
{props.option.showIcon&&
}
{props.children}
)
}
当我这样做的时候,props中唯一的东西就是两个子项(MultiValueLabel和MultiValueRemove)。如何访问此处的选项数据?结果表明,我只需要使用react select v2的稳定版本。Beta-6破坏了功能。MultiValueContainer/MultiValueLabel现在按预期接收基础选项数据