# react-geoip-phone-input-new

> A react component to format phone numbers with geoIp

Latest version **1.0.2** (published 2017-12-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-geoip-phone-input-new
pnpm add react-geoip-phone-input-new
yarn add react-geoip-phone-input-new
bun add react-geoip-phone-input-new
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2017-12-12 |
| First published | 2017-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nik5036350 |
| Maintainers | omarahmed |
| Keywords | react, phone, format, telephone, geoip, geocoding, ipgeocoding |

## Links

- npm: https://www.npmjs.com/package/react-geoip-phone-input-new
- Repository: https://github.com/Nik5036350/react-phone-input
- Issues: https://github.com/Nik5036350/react-phone-input/issues
- npm.io page: https://npm.io/package/react-geoip-phone-input-new

## Dependencies (4)

- [react](https://npm.io/package/react.md) ^16.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.11.1
- [classnames](https://npm.io/package/classnames.md) ^2.1.5
- [prop-types](https://npm.io/package/prop-types.md) ^15.6.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2017-12-12
- 1.0.1 — 2017-12-12
- 1.0.0 — 2017-12-12

## README

# react-phone-input
A simple react component to format a phone number as the user types with integrated user country detection via geoIp provided by <a href="https://ip-api.io" target="_blank">ip-api.io</a>. (forked from 
<a href="https://github.com/razagill/react-phone-input" target="_blank">https://github.com/razagill/react-phone-input</a>)

## Live demo


<a target="_blank" href="https://nik5036350.github.io/react-phone-input/">Click to see live demo</a>

![alt tag](http://i.giphy.com/l41m24L5YTSOifyW4.gif)

## Installation:

```shell-script
npm install react-geoip-phone-input --save
```

  
## Usage:

```jsx
React.render(
  <ReactPhoneInput defaultCountry={'us'} onChange={handleOnChange)/>,
  document.getElementById('content'));
```

Your handler for the ``onChange`` event should expect a string as
parameter, where the value is that of the entered phone number. For example:

```jsx
function handeOnChange(value) {
   this.setState({
      phone: value
   });
}
```
## Options:

| Name | Description          |
| :------------- | :----------- |
| value | string, phone number value|
| defaultCountry | country code to initialize the component|
| excludeCountries | array of country codes to be excluded e.g. ['cu','cw','kz']|
| onlyCountries | array of country codes to be included e.g. ['cu','cw','kz']|
| preferredCountries | array of country codes to be preferred (highlighted at the top) e.g. ['cu','cw','kz']|
| ipGeocodingEnabled | boolean flag to turn on/off ip geocoding (default - true)|

## License

[MIT](https://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/react-geoip-phone-input-new · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
