在材质ui中滚动inselect

时间:2018-11-22 05:49:46

标签: javascript reactjs material-ui

我一直试图在{strong>材料界面中的select中使用onScroll来加载select中的更多项目,但是我感到的问题是API被调用了无数次。该问题如何解决?

<Select
  onScroll={this.props.loadMoreOrganizations}
  value={this.state.organizationselected}
  onChange={this.handleChangeorganization}
  inputProps={{
    name:"organizationselected",
    id:"age-simple"
  }}
>
<MenuItem value="">
<em>None</em>
</MenuItem>
{
  organizations.map(item=>{
    return <MenuItem value={item._id}>{item.title}</MenuItem>
  })
}
</Select>

但是,我看到的是由于这个原因,API被调用了无数次。

0 个答案:

没有答案
相关问题