lucasfloriani / use-via-cep

Hook to abstract the logic to call viacep

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Hook to abstract the logic to call viacep


Languages

Language:JavaScript 45.8%Language:TypeScript 37.2%Language:HTML 14.9%Language:CSS 2.1%