how to alert a user if the user types a symbol into a text input in react? I tried this
textChange = () => {
if (this.state.texts == new RegExp(/[^a-zA-Z\s]/) ) {
alert("No symbols allowed")
}
}
but noting is alerting when a symbol is type
if( new RegExp(/[^a-zA-Z\s]/).test(this.state.texts) )/[^a-zA-Z\s]/.test(this.state.texts)