title: How to prevent user from entering negative number in react?
body: <p>I want to restrict users from entering negative values. I am using min = &quot;0&quot;. With this i can restrict users from decrementing to 0, i.e, users can only decrement value till 0. But they are able to type &quot;-&quot;. How to prevent in react js.</p>
  <p><a href="https://codesandbox.io/s/react-input-example-forked-xnvxm?file=/src/index.js" rel="nofollow noreferrer">https://codesandbox.io/s/react-input-example-forked-xnvxm?file=/src/index.js</a></p>
  <pre><code>&lt;input
     type=&quot;number&quot;
     min=&quot;0&quot;
     step=&quot;1&quot;                        
     onChange={this.handleChange}                        
     className=&quot;w-100&quot;
     value= &quot;1&quot;
     /&gt;
  </code></pre>