you should use an if statement at your handleSubmit
function
handleSubmit(event) {
if(this.state.value){
alert('A name was submitted: ' + this.state.value);
}
event.preventDefault();
}
this way if value is equal to ''
alert would not be shown if it contains any character such as 'm'
it would show the alert
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…