title: Trigger onblur event on click of enter keypress in React js
body: <p>I have an input text field . When a user inputs any text and clicks enter button I need to activate the blur event to remove the focus and also to validate the textinput .</p>
  <pre><code>&lt;input type=&quot;text&quot; 
      style={{marginTop:'20%', marginLeft:'40%'}} 
      value={value} 
      onFocus={onFocus}
      onChange={e =&gt; setValue(e.target.value)}
      onKeyPress={handleKeyPress}
  /&gt;
  </code></pre>