Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lucasfloriani/use-via-cep

Hook to abstract the logic to call viacep
https://github.com/lucasfloriani/use-via-cep

es6 hooks react typescript viacep

Last synced: about 2 months ago
JSON representation

Hook to abstract the logic to call viacep

Awesome Lists containing this project

README

        

# use-via-cep

> Hook to abstract the logic to call viacep

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

## Install

```bash
npm install --save use-via-cep
```

## Usage

```tsx
import * as React from 'react'

import { useViaCep } from 'use-via-cep'

const Example = () => {
const { cep, data, setCep } = useViaCep()
return (


setCep(target.value)} />
{JSON.stringify(data)}


)
}
```

## License

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

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).