Skip to content

Instantly share code, notes, and snippets.

@hanipcode
Created September 26, 2017 13:21
Show Gist options
  • Select an option

  • Save hanipcode/7e2b56326b5dc970fc7c33591cae8dc5 to your computer and use it in GitHub Desktop.

Select an option

Save hanipcode/7e2b56326b5dc970fc7c33591cae8dc5 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import AutoCompleteBox from '../components/AutoCompleteBox';
import AutoCompleteResultList from '../components/AutoCompleteResultList';
class SearchPage extends Component {
constructor(props) {
super(props);
this.state = {
query: '',
data: []
};
}
render() {
return (
<View>
<AutoCompleteBox
placeholder="Masukan Nama Tempat"
value={this.state.query}
onChangeText={query => this.setState({ query })}
/>
<AutoCompleteResultList data={this.state.data} />
</View>
);
}
}
export default SearchPage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment