Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
rn-google-places-api-autocomplete
Advanced tools
Readme
A customizable autocomplete component made for React Native that interacts with the Google Places API, which has several ways to visualize the places.
npm i rn-google-places-api-autocomplete
yarn add rn-google-places-api-autocomplete
pnpm add rn-google-places-api-autocomplete
Get your Google Places API Key
GooglePlacesAutocomplete
component internally
uses @gorhom/bottom-sheet. You need to follow this
installation steps
You can take a look at the example
If you are going to use the bottom-sheet visualization mode, you need to configure the bottom sheet modal provider, like this:
import React from "react"
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import { GooglePlacesAutocomplete } from 'rn-google-places-api-autocomplete';
const App = () => {
return (
<BottomSheetModalProvider>
<GooglePlacesAutocomplete visualization="bottom-sheet" apiKey="12345" />
</BottomSheetModalProvider>
);
};
Controlled Field
import React, { useState } from 'react';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import { GooglePlacesAutocomplete, BottomSheetOptionType } from 'rn-google-places-api-autocomplete';
const App = () => {
const [selectedOption, setSelectedOption] =
useState<BottomSheetOptionType | null>(null);
return (
<GooglePlacesAutocomplete
visualization='list'
apiKey='12345'
onChange={(option) => setSelectedOption(option)}
selectedOption={selectedOption}
/>
);
};
Limit results to one country
import React from 'react';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import { GooglePlacesAutocomplete } from 'rn-google-places-api-autocomplete';
const App = () => {
return (
<BottomSheetModalProvider>
<GooglePlacesAutocomplete
visualization='bottom-sheet'
apiKey='12345'
query={{
components: 'country:co', // Limit to Colombia's Places
types: '(cities)', // Limit search to cities
language: 'es',// response in spanish
}}
/>
</BottomSheetModalProvider>
);
};
FAQs
A customizable autocomplete component made for React Native that interacts with the Google Places API, which has several ways to visualize the places.
The npm package rn-google-places-api-autocomplete receives a total of 2 weekly downloads. As such, rn-google-places-api-autocomplete popularity was classified as not popular.
We found that rn-google-places-api-autocomplete demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.