New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-places-input

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-places-input

Up to date working Google Places Input. Calling directly API not JS SDK.

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56
decreased by-62.67%
Maintainers
1
Weekly downloads
 
Created
Source

React Native Places Input

Up to date working Google Places Input. Calling directly API not JS SDK.

exmaples

Installation

yarn add react-native-places-input

or

npm intsall react-native-places-input

Usage

Fairly easy. Few required props but most of the work is already done in a component.

Basic

import PlacesInput from 'react-native-places-input';

And inside a component

    <PlacesInput
        googleApiKey={GOOGLE_API_KEY}
        onSelect={place => console.log(place}
    />
class InputWrapper extends React.Component {
    render() {
        return (
            <View style={{ width: '100%' }}>
                <PlacesInput
                    googleApiKey={GOOGLE_API_KEY}
                    placeHolder={"Some Place holder"}
                    language={"en-US"}
                    onSelect={place => {
                        this.props.goToPoint(get(place, 'result.geometry.location.lat'), get(place, 'result.geometry.location.lng'))
                    }}
                    iconResult={<Ionicons name="md-pin" size={25} style={styles.placeIcon}/>}
                />
            </View>
        );
    }
}

Configuration props

List of props supported by a component

PropTypeDefaultDescription
googleApiKeyPropTypes.string.isRequired,Google API key
iconInputPropTypes.any,Icon added to an input
iconResultPropTypes.any,Icon added to results
languagePropTypes.string,enLanguage for google API call
placeHolderPropTypes.string,Search places...placeholder for an input
queryFieldsPropTypes.string,formatted_address,geometry,nameFields requested from Google API
resultRenderPropTypes.func,place => place.descriptionFunction to render results text
searchLatitudePropTypes.number,51.905070Lat to limit results
searchLongitudePropTypes.number,19.458834Lng to limit results
searchRadiusPropTypes.number,1000radius to limit results
stylesContainerPropTypes.object,{}Custom styles for a container
stylesInputPropTypes.object,{}Custom styles for an input
stylesItemPropTypes.object,{}Custom styles for an item
stylesItemTextPropTypes.object,{}Custom styles for an item text
stylesListPropTypes.object,{}Custom styles for a list
stylesLoadingPropTypes.object,{}Custom styles for a loading indicator
textInputPropsPropTypes.object,{}Custom TextInput props
onSelectPropTypes.func,Function called when you select a place

Keywords

FAQs

Package last updated on 02 Mar 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc