Skip to content

Instantly share code, notes, and snippets.

@hanipcode
Created September 26, 2017 14:58
Show Gist options
  • Select an option

  • Save hanipcode/6e0418caf6946fc136602fc8a10923a3 to your computer and use it in GitHub Desktop.

Select an option

Save hanipcode/6e0418caf6946fc136602fc8a10923a3 to your computer and use it in GitHub Desktop.
//..rest of the code still the same
class AutoCompleteResultList extends Component {
renderItem({ item }) {
return (
<View style={styles.AutoCompleteResultItem}>
<Text style={styles.titleText}>{item.name}</Text>
<Text style={styles.text}>{item.formatted_address}</Text>
</View>
);
}
render() {
return (
<View>
{this.props.data.length > 0 && (
<FlatList
{...this.props}
contentContainerStyle={styles.AutoCompleteResultList}
renderItem={this.renderItem}
/>
)}
</View>
);
}
}
//..rest of the code still the same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment