Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 试图覆盖react select中的MultiValueContainer,但它未接收选项数据_Reactjs_React Select - Fatal编程技术网

Reactjs 试图覆盖react select中的MultiValueContainer,但它未接收选项数据

Reactjs 试图覆盖react select中的MultiValueContainer,但它未接收选项数据,reactjs,react-select,Reactjs,React Select,我试图覆盖多值容器,以便可以选择在多值标签旁边显示一个图标。我已经用MultiValueLabel组件尝试过了,但是文档表明它没有收到选项值,但是MultiValueContainer收到了 <CreatableSelect components={MultiValueContainer: CustomMultiValueContainer} ... const CustomMultiValueContainer = (props) => { return (

我试图覆盖多值容器,以便可以选择在多值标签旁边显示一个图标。我已经用MultiValueLabel组件尝试过了,但是文档表明它没有收到选项值,但是MultiValueContainer收到了

<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现在按预期接收基础选项数据