Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
react-google-uni-autocomplete
Advanced tools
This is two react components 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>
#Simple component out of box.
import {ReactGoogleAutocomplete} from 'react-google-autocomplete';
<ReactGoogleAutocomplete
style={{width: '90%'}}
onPlaceSelected={(place) => {
console.log(place);
}}
/>
The component has one function called onPlaceSelected
. The function gets invoked every time a user chooses location.
#Custom component
This component allows you point your own component as input, list's box, item. Here is example.
import {ReactCustomGoogleAutocomplete} from 'react-google-autocomplete';
//input itself
<ReactCustomGoogleAutocomplete
{...fields.cityAutocomplete}
input={<TextField/>}
style={{width: '90%'}}
initialValue={fields.location.value}
onOpen={(list) => this.setState({list})}
onClose={() => this.setState({list: null})}
/>
//dropdown container
<PopupContainer
isOpened={this.state.list}
onClose={() => {
if (this.state.list) {
this.setState({list: null});
}
}}
>
{this.state.list && this.state.list.map(item =>
<FlatButton
style={{width: '100%', textAlign: 'left'}}
onClick={() => {
console.log(item);
}}
label={item.description}
/>
)}
</ PopupContainer>
Props
FAQs
React components for google autocomplete.
The npm package react-google-uni-autocomplete receives a total of 3 weekly downloads. As such, react-google-uni-autocomplete popularity was classified as not popular.
We found that react-google-uni-autocomplete 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.