Я добавил response-native-google-places-autocomplete с пряжей в свой проект cli, поддерживающий реакцию, но он не работает. Вот проблемы, с которыми я столкнулся в настоящий момент.
раскрывающийся список мест не отображается на IOS, однако текстовое поле ввода позволяет мне ввести название места, но список прогнозов не отображается
Обработчик onPress вообще не запускается как на iOS, так и на android
Текстовый ввод, поступающий из response-native-google-places-autocomplete, не позволяет мне вводить что-либо на ANDROID. Это похоже на то, что все время отключено (хотя фокус установлен на true)
Примечание: все api местоположения Google включены, api карт google, api мест и api геокода включены, и указан действительный ключ api.
Я перепробовал все возможные решения, включая следующие:
установка zIndex: 1000 высокого значения, чтобы избежать его скрытия за каким-либо другим видом
Пытался создать новое приложение RN и добавил только этот компонент, чтобы проект оставался чистым.
- Повторное создание API и даже использование другого API, который работает с предыдущими версиями REACT NATIVE.
Журналы ничего не показывают ни в Xcode, ни в Android Studio. Вот фрагмент кода:
<View style = {[{zIndex: 2, backgroundColor: 'white'}]}>
<GooglePlacesAutocomplete
ref = {ref => setSearchTextRef(ref)}
placeholder='Search for gym'
styles={{
container: {backgroundColor: 'transparent'},
textInputContainer: styles.viewStyle,
textInput: styles.textInputStyle,
}}
keyboardShouldPersistTaps = {'handled'}
listUnderlayColor = {'transparent'}
textInputProps = {{
onFocus: () => focusInput(),
onBlur: () => blurInput(),
onChangeText: (text) => onChange(text)
}}
minLength={1} // minimum length of text to search
returnKeyType={'search'}
listViewDisplayed={'auto'} // true/false/undefined
fetchDetails={true}
renderDescription={row => row.description} // custom description render
onPress={(data, details = null) => {
let coordinates = details.geometry.location;
sendCoordinates(coordinates, {data, details});
}}
getDefaultValue={() => ''}
query={{
key: googleAPIKey,
language: 'en', // language of the results
// types: '(cities)' // default: 'geocode'
}}
nearbyPlacesAPI='GooglePlacesSearch' // Which API to use: GoogleReverseGeocoding or GooglePlacesSearch
GooglePlacesSearchQuery={{
rankby: 'distance',
types: 'gym'
}}
filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']}
debounce={200}
/>
</View>
заранее спасибо