use-via-cep
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

use-via-cep

Hook to abstract the logic to call viacep

NPM JavaScript Style Guide

Install

npm install --save use-via-cep

Usage

import * as React from 'react'

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

const Example = () => {
  const { cep, data, setCep } = useViaCep()
  return (
    <div>
      <input value={cep} onChange={({ target }) => setCep(target.value)} />
      <pre>{JSON.stringify(data)}</pre>
    </div>
  )
}

License

MIT © lucasfloriani


This hook is created using create-react-hook.

Readme

Keywords

none

Package Sidebar

Install

npm i use-via-cep

Weekly Downloads

26

Version

1.0.2

License

MIT

Unpacked Size

1.28 MB

Total Files

26

Last publish

Collaborators

  • lucasfloriani