0.0.6 • Published 2 years ago
@plasmatictechnologies/alana-react-native-address-autocomplete v0.0.6
Address Input Component with SmartyStreets Autocomplete for React Native
Customizable address input component with SmartyStreets autocomplete iOS and Android React-Native apps
Installation
Step 1.
npm install alana-react-native-address-autocomplete --save
or
yarn add alana-react-native-address-autocomplete
Step 2.
Get your SmartyStreets US Autocomplete Pro API key. Ensure you setup host/referer URL as well, without it the autocomplete won't work.
Caveats
The component uses React Native's FlatList under the hood. Using this input inside of a ScrollView shouldn't be a problem, however it isn't recommended. A bit more on this here. If you have to have this input inside of a ScrollView, you can suppress the React Native warning. Here's how it could be done:
For RN 0.63 and above
FUNCTIONAL
import React, { useEffect } from 'react';
import { LogBox } from 'react-native';
useEffect(() => {
LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
}, [])
CLASS BASED
import React from 'react';
import { LogBox } from 'react-native';
componentDidMount() {
LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
}
For RN below 0.63
FUNCTIONAL
import React, { useEffect } from 'react';
import { YellowBox } from 'react-native';
useEffect(() => {
YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
}, [])
CLASS BASED
import React from 'react';
import { YellowBox } from 'react-native';
componentDidMount() {
YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
}