title: How to use a useState in react-hooks with percentage and conditions?
body: <p>i'm a new student on react library and i have a doubt with a question in react-hooks...</p>
  <p>let's see</p>
  <p>im trying to make a new component that ask a first name, last name and participation in the company, and the participation do not pass 100% but whenever I put a value on the form it change,
  I was wondering if there is a way to save data from this input so that only users can make up to 100% of the company</p>
  <p>the code:</p>
  <pre><code>import React, {useState} from 'react';
  import './App.css';
  
  const App = () =&gt; {
    const [firstName, setFirstName] = useState(' ');
    const [lastName, setLastName] = useState(' ');
    const [participation, setParticipation] = useState([]);
    
    const handlePartner = (e) =&gt; {
      e.preventDefault();
      const data = {
        firstName,
        lastName,
        participation
      }
      
    }
  
  
    return (
      &lt;div&gt;
        &lt;div className=&quot;header&quot;&gt;
          &lt;form action=&quot;&quot; onSubmit={handlePartner}&gt;
                &lt;input type=&quot;text&quot;  placeholder=&quot;First Name&quot; value={firstName} onChange={e =&gt; setFirstName(e.target.value)}/&gt;
                &lt;input type=&quot;text&quot; placeholder=&quot;Last Name&quot; value={lastName} onChange={e =&gt; setLastName(e.target.value)}/&gt;
                &lt;input type=&quot;number&quot; placeholder=&quot;Participation&quot; value={participation} onChange={e =&gt; 
                e.target.value &lt;= 100 &amp;&amp; e.target.value &gt;= 0 ? setParticipation(e.target.value) : null}
                  /&gt;
                &lt;button type=&quot;submit&quot;&gt;SEND&lt;/button&gt;
          &lt;/form&gt;
        &lt;/div&gt;
        &lt;div className=&quot;data&quot;&gt;
          &lt;h1&gt;DATA&lt;/h1&gt;
          &lt;p&gt;Lorem ipsur dolor sit amet, consectetur adipiscing elit.&lt;/p&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    )
  }
  
  export default App;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/3vqN1.png" rel="nofollow noreferrer">Image of the app</a></p>
  <p>I am very grateful for the help</p>