I am looking for the return value to impact the parent function, like so:
const blockLetters = lastD => {
if(lastD != undefined && isNaN(Number.parseInt(lastD))){
return;
}
}
const handleCVC = e => {
e.preventDefault();
let newcvc = e.target.value;
let newcvcArr = newcvc.split("");
let newLength = (e.target.value).length;
let lastNewDigit = newcvcArr[newLength-1]
blockLetters(lastNewDigit);
setcvc(newcvc)
}
The goal is for the returns from blockLetters to directly affect the handleCVC function, preventing it from executing its final line. However, currently these returns only impact the blockLetters function itself.