I have input field from which is InputText from PrimeReact and content of this field should always be text, not figures. I want to disable possibility to type figures. Below is code example. I also tried to make validation if typeof data is 'number' and then display comment, but data from input as I see is always a string
<FloatingLabel text="Name" name={`luxmeds.${index}.persons.${idx}.name`}>
<StyledInputText
name={`luxmeds.${index}.persons.${idx}.name`}
value={person.name}
onChange={handleChange}
type="text"
/>
</FloatingLabel>
{!values.luxmeds[index].persons[idx].name && (
<StyledWarningText>{'You need to provide a name'}</StyledWarningText>
)}
{typeof values.luxmeds[index].persons[idx].name === 'number' && (
<StyledWarningText>{'You need to provide a name'}</StyledWarningText>
)}
Can You please suggest how to achieve that ?
regards