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: 3 months ago
JSON representation
Hook to abstract the logic to call viacep
- Host: GitHub
- URL: https://github.com/lucasfloriani/use-via-cep
- Owner: lucasfloriani
- Created: 2019-12-25T19:47:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T01:55:21.000Z (about 1 year ago)
- Last Synced: 2024-09-26T07:35:55.385Z (10 months ago)
- Topics: es6, hooks, react, typescript, viacep
- Language: JavaScript
- Homepage:
- Size: 650 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# use-via-cep
> Hook to abstract the logic to call viacep
[](https://www.npmjs.com/package/use-via-cep) [](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).