反应原生自动填充

时间:2018-09-21 12:17:24

标签: react-native autocomplete

我是React Native的新手,我遇到了AutoCompelte的困难,我有一个要从服务器获取的Json文件

constructor(props) {
super(props);
this.state = {
  recentPro: [],

}
}  
const url = {url}
fetch(url)
  .then((response) => response.json())
  .then((responseJson) => {
    this.setState({
      recentPro: responseJson.products,

    })
  })

<AutoComplete
      suggestions={this.state.recentPro}
      onTyping={this.onTyping}
      onSelect={this.onSelect}
      placeholder="Search for a country"
      clearButtonMode="always"
      returnKeyType="go"
      textAlign="center"/>

如何通过过滤建议在自动完成的建议中显示最近的Pro.pro_name和最近的Pro.pro_img?

0 个答案:

没有答案