Skip to content

Instantly share code, notes, and snippets.

@thiagobutignon
Created January 29, 2020 04:16
Show Gist options
  • Save thiagobutignon/8061b5a5a72efb562323ce3675549b79 to your computer and use it in GitHub Desktop.
Save thiagobutignon/8061b5a5a72efb562323ce3675549b79 to your computer and use it in GitHub Desktop.
{touched.zipcode && !errors.zipcode
? setTimeout(() => {
cep(values.zipcode)
.then(response => {
setFieldTouched('zipcode', false);
console.log(response);
setFieldValue('street', response.street);
setFieldValue('city', response.city);
setFieldValue('state', response.state);
setFieldValue('neighborhood', response.neighborhood);
}, 100)
.catch(error => console.log(error));
})
: console.log('deu ruim')}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment