# react-input-phone-code

> Component to select phone-code

Latest version **1.0.3** (published 2022-05-11) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-05-11 |
| First published | 2022-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 312.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | FrankNolasco |
| Maintainers | franksitokawai |

## Links

- npm: https://www.npmjs.com/package/react-input-phone-code
- Repository: https://github.com/FrankNolasco/react-phone-code
- Homepage: https://github.com/FrankNolasco/react-phone-code#readme
- Issues: https://github.com/FrankNolasco/react-phone-code/issues
- npm.io page: https://npm.io/package/react-input-phone-code

## Recent versions

- 1.0.3 (latest) — 2022-05-11
- 1.0.2 — 2022-05-11
- 1.0.1 — 2022-05-03
- 1.0.0 — 2022-05-03

## README

# react-input-phone-code

> Component to select phone-code

[![NPM](https://img.shields.io/npm/v/react-input-phone-code.svg)](https://www.npmjs.com/package/react-input-phone-code) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save react-input-phone-code
```

## Usage Basic

> No need to import css in your project.

On Typescript

```ts
import React, { useState } from 'react';

import { PhoneCode, TypeValueExpected } from 'react-phone-code';

const App = () => {
  const [value, setValue] = useState<TypeValueExpected>();
  return (
    <div>
      <PhoneCode value={value} onChange={setValue} />
    </div>
  );
};

export default App;
```

On JavaScript

```js
import React, { useState } from 'react';

import { PhoneCode } from 'react-phone-code';

const App = () => {
  const [value, setValue] = useState();
  return (
    <div>
      <PhoneCode value={value} onChange={setValue} />
    </div>
  );
};

export default App;
```

## Usage With react-hook-form

```js
import React, { useState } from 'react';
import { useForm, Controller } from 'react-hook-form';
import { PhoneCode } from 'react-phone-code';

const App = () => {
  const { control, handleSubmit } = useForm();
  const onSubmit = data => {
    console.log(data);
  };

  return (
    <form onSubmit={handleSubmit(onSubmit)}>
      <Controller
        control={control}
        name='phone'
        render={({ onChange, value }) => (
          <PhoneCode value={value} onChange={onChange} />
        )}
      />
    </form>
  );
};

export default App;
```

## License

MIT © [FrankNolasco](https://github.com/FrankNolasco)

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