useCep is a react hook for get address information from viacep,
npm install react-hook-usecep -S
import useCep from 'react-hook-usecep';
function MyReactComponent(){
const [status, setCep] = useCep()
return (<input type="text" onBlur={(e)=>{ setCep(e.target.value) }} />)
}
{
"loading": false,
"error": false,
"data": {
"cep": "01001-000",
"logradouro": "Praça da Sé",
"complemento": "lado ímpar",
"bairro": "Sé",
"localidade": "São Paulo",
"uf": "SP",
"ibge": "3550308",
"gia": "1004",
"ddd": "11",
"siafi": "7107"
}
}