Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
react-native-autocomplete-input
Advanced tools
This is a pure javascript react-native component to display autocomplete suggestions given an array of objects respective to the input text.
Fist things first install the component from npmjs.org:
$ npm install --save react-native-autocomplete-input
or install HEAD from github.com:
$ npm install --save l-urence/react-native-autocomplete-input
This brief example should illustrate the usage of the autocomplete:
// ...
render() {
const { query } = this.state;
const data = this._filterData(query)
<Autocomplete
data={data}
defaultValue={query}
onChangeText={text => this.setState({query: text})}
renderItem={data => (
<TouchableOpacity onPress={() =>
this.setState({query: data})
}
>
<Text>{data}</Text>
</TouchableOpacity>
)}
/>
}
// ...
The full example from the screenshot can be found here
Prop | Type | Description |
---|---|---|
containerStyle | style | These styles will be applied to the container which surrounds the autocomplete component. |
data | array | Assign an array of data objects which should be rendered in respect to the entered text. |
listStyle | style | These style will be applied to the result list view. |
renderItem | function | renderItem will be called to render the data objects which will be displayed in the result view below the text input. |
Feel free to open issues or do a PR!
FAQs
Pure javascript autocomplete input for react-native
The npm package react-native-autocomplete-input receives a total of 12,333 weekly downloads. As such, react-native-autocomplete-input popularity was classified as popular.
We found that react-native-autocomplete-input demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.