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 autosuggest与react自定义滚动条一起使用_Reactjs - Fatal编程技术网

Reactjs 将react autosuggest与react自定义滚动条一起使用

Reactjs 将react autosuggest与react自定义滚动条一起使用,reactjs,Reactjs,是否可以将react自定义滚动条与react autosuggest一起使用? 我是为自动建议写的,但它不能正常工作: renderSuggestionsContainer({ containerProps, children, query }) { const callRef = scrollbars => { if (scrollbars !== null) { ref(scrollbars); } }

是否可以将
react自定义滚动条
react autosuggest
一起使用? 我是为
自动建议
写的,但它不能正常工作:

renderSuggestionsContainer({ containerProps, children, query }) {
    const callRef = scrollbars => {
        if (scrollbars !== null) {
            ref(scrollbars);
        }
    }

    return (
        <Scrollbars
        autoHeight
        autoHeightMax={240}
        id={this.props.id}
        ref={callRef}
        renderTrackVertical={() => <div className="scrollbars-wrapper" />}
        renderThumbVertical={() => <div className="scrollbar-handler" />}>
        {children}
        </Scrollbars>
    );
}
renderSuggestionsContainer({containerProps,children,query}){
常量callRef=滚动条=>{
如果(滚动条!==null){
参考(滚动条);
}
}
返回(
}
renderThumbVertical={()=>}>
{儿童}
);
}

如何实现?

如果想要实现react js自动建议框,那么您可以简单地使用“react select”,具有滚动、加载等所有特性。 您将在此处找到更多详细信息

如果您想用react native实现自己的 然后,您应该使用列表视图来代替滚动条,因为它更像羽毛

  • ios和android的自动缓存图像

  • 方法,该方法有助于实现无限滚动。等


谢谢RANVIR<代码>反应自动建议
也有滚动功能。但我想定制它。我选择了
react custom scrollbars
,但无法将它们配置为一起工作。