simple-react-validator icon indicating copy to clipboard operation
simple-react-validator copied to clipboard

conditional rendering error not hiding issue

Open dmhd007 opened this issue 1 year ago • 0 comments

hi team , for conditional rendering fields how can i use simple-react-validator ?

{application?.isListed === 'Y' ? <TextField name='nameOfListed' value={application?.nameOfListed} onChange={onChange} onBlur={simpleValidator.current.showMessageFor('nameOfListed')} />

{simpleValidator.current.message('nameOfListed', application?.nameOfListed, 'required')}

: ''}

issue is when i change application?.isListed to 'N' , the field hidden , but validation error exists on validator.current.getErrorMessages()

@stuyam

dmhd007 avatar Sep 11 '23 07:09 dmhd007