Below code is taken from reactjs.org, my question is how to handle the empty value in the below code. Alert should trigger only when there is some input from the user, it should not trigger if the input is empty Answer you should use an if statement at your handleSubmit function this way if value is equal to ” alert