
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
react-google-autocomplete
Advanced tools
This is a simple react component for working with google autocomplete
npm i react-google-autocomplete --save
You also have to include google autocomplete link api in your app. Somewhere in index.html or somwehrer else.
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=[YOUR_API_KEY]&libraries=places"></script>
import Autocomplete from 'react-google-autocomplete';
<Autocomplete
style={{width: '90%'}}
onPlaceSelected={(place) => {
console.log(place);
}}
types={['(regions)']}
componentRestrictions={{country: "ru"}}
/>
The component has one function called onPlaceSelected
. The function gets invoked every time a user chooses location.
A types
props means type of places in google place API. By default it uses (cities).
A componentRestrictions prop by default is empty.
A bounds prop by default is empty.
You also can pass any props you want to the final input.
If you would like to see something in this library please create an issue and I will implement it as soon as possible.
The react-places-autocomplete package is another React component for integrating Google Places Autocomplete into your application. It offers similar functionality to react-google-autocomplete, including the ability to restrict search results by types and countries. However, it provides more customization options for rendering the autocomplete suggestions.
The react-geosuggest package is a React component for Google Maps Places Autocomplete. It provides similar functionality to react-google-autocomplete but also includes additional features such as custom styling and event handling. It is a good alternative if you need more control over the appearance and behavior of the autocomplete component.
FAQs
React component for google autocomplete.
The npm package react-google-autocomplete receives a total of 112,746 weekly downloads. As such, react-google-autocomplete popularity was classified as popular.
We found that react-google-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.
Security News
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.