Closed 3runoDesign closed 4 years ago
I can't set a field value after an onBlur.
something like:
const handleCEP = (ev, props) => { props.handleChange(ev); fetch(`https://viacep.com.br/ws/77807060/json/`) .then((res) => res.json()) .then((data) => { props.setFieldValue("logradouro", data.logradouro); }); };
<Field name="cep" component={TextField} type="text" label="CEP" placeholder="Qual seu CEP?" variant="outlined" onBlur={(ev) => handleCEP(ev, props)} fullWidth />
Can you help me? Thank you!
answered in #5
I can't set a field value after an onBlur.
something like:
Can you help me? Thank you!