我正在使用react-select-fast-filter-optionsselect并在搜索任何内容时,即使标签中存在针对它的条目,我也没有得到任何结果。
我已经看到了这个问题,我面临着一个非常相似的问题,但我没有将任何非默认属性传递给react-virtualized-select.
我的代码如下:
import "react-select/dist/react-select.css";
import React from "react";
import ReactDOM from "react-dom";
import createFilterOptions from "react-select-fast-filter-options";
import Select from "react-select";
import faker from "faker";
// Dummy array of test values.
const options = Array.from(new Array(100), (_, index) => ({
label: faker.lorem.sentence(),
value: index
}));
export default class SelectComponent extends React.Component {
render() {
console.log(this.props.alloptions);
return (
<Select
options={this.props.alloptions}
filterOptions={createFilterOptions(this.props.alloptions)}
/>
);
}
}
ReactDOM.render(
<SelectComponent alloptions={options} />,
document.getElementById("root")
);
我的猜测是,我执行的数据索引react-select-fast-filter-options是使用一些我不知道的隐藏字段完成的。
有什么我想念的吗?