
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
react-geocomplete
Advanced tools
A React autosuggest/autocomplete for the Google Maps Places API. Also comes with a validation component.
A React autosuggest for the Google Maps Places API. This is based on Ubilabs' Geosuggest. For rundown of important differences, please see below.
value()
getter method.As this component uses the Google Maps Places API to get suggests, you must include the Google Maps Places API in the <head>
of your HTML:
<!DOCTYPE html>
<html>
<head>
…
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY_HERE&libraries=places"></script>
</head>
<body>
…
</body>
</html>
Visit the Google Developer Console to generate your API key.
The easiest way to use geocomplete is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc).
You might also be able to use the standalone build by including dist/react-geosuggest.js
in your page. If you use this, make sure you have already included React, and it is available as a global variable. I've never been able to get this to work though.
npm install react-geocomplete --save
For using the base component, please see Ubilabs documentation. It's mostly the same as that.
The ValidatedGeocomplete is very similar to the Geocomplete component, except that it allows you to validate that your input matches an autocomplete description or that the field is required. You can provide a custom component for the validation errors.
Type: Component
Default: null
This element, when provided, will impose a validation constraint on the element that its value must match an autocomplete suggestion description. The notFoundErrorComponent
component may make use of the userInput
property which will be passed to it.
Type: Component
Default: null
This element, when provided, will impose a validation constraint on the element that its value must be present.
See LICENSE.md
FAQs
A React autosuggest/autocomplete for the Google Maps Places API. Also comes with a validation component.
We found that react-geocomplete demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.