Here is my code to show up the snackbar once the seterror is detected - i cant get to figure out why it doesn't work in one of the methods - however it does show up in the return statement of my component which isn't exactly what I need. I need to return the snack bar only if the seterror is detected. I tried using material input inputComponent prop to call my doesn't accept the component either. Help please!!
const _onBlur = () => {
updateData(value);
_isValid(value);
};
const _isValid = (value: string) => {
if(isNaN(+value) != false){
seterror(true);
return (
/* eslint-disable */
)
} else {
seterror(false);
}
};
return (
<>
id={id}
value={value}
onChange={_onChange}
onBlur={_onBlur}
error={error}
/>
</>
);
};
Top comments (0)