1.0.9 • Published 5 years ago
react-native-autocomplete-france-address v1.0.9
react-native-autocomplete-france-address
Module for React Native & Expo that helps you to create an address autocompletion based on Data.gouv
Demo
Installation
NPM
npm install react-native-autocomplete-france-address --saveYarn
yard add react-native-autocomplete-france-addressExpo
expo install react-native-autocomplete-france-address --saveUsage
Basic
import AutocompleteAddress from 'react-native-autocomplete-france-address'
render() {
return <AutocompleteAddress isOpen={this.state.modalAddress}
onFindAddress={(address) => {
console.log(address)
}}
onCloseModal={() => this.setState({modalAddress: false})}
placeholder={"Cherchez une adresse, un lieu..."}/>
}Properties
Required
- onFindAddress(address):
Functionthat return address from API when user click on entry. - onCloseModal():
Functioncalled when the modal need to be closed. - isOpen:
Booleanthat determinate if the modal for searching address is open or not. placeholder:
String.
Optional
- onSearchError(error):
Functionthat return an error if there is an error during the search. - containerStyle:
Objectfor the container style. - inputStyle:
Objectfor the input style. - addressStyle:
Objectfor the suggested rows address text. - cityStyle:
Objectfor the suggested rows cities text. - inputWidth:
Numberwidth of the input.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.