title: Getting NaN after adding the same number twice
body: <p>I'm having an issue with my code , when I try to add the same number (amount) to my input - I'm getting NaN.
  It only happens when I add two identical numbers (66 and then 66 for example) - but it does work properly when I add a different number.</p>
  <p><strong>App.js :</strong></p>
  <pre><code>import Outcome from &quot;./components/Outcome&quot;;
  import Income from &quot;./components/Income&quot;;
  
  const App = () =&gt; {
    const [sum, setSum] = useState(0);
  
    const onChangeHandlerOutcome = (value) =&gt; {
      setSum((prevState) =&gt; prevState - value);
      console.log(value);
    };
  
    const onChangeHandlerIncome = (value) =&gt; {
      setSum((prevState) =&gt; prevState + value);
    };
  
    return (
      &lt;div&gt;
        &lt;Outcome onChangeHandlerOutcome={onChangeHandlerOutcome} /&gt;
        &lt;Income onChangeHandlerIncome={onChangeHandlerIncome} /&gt;
        You have {sum}$!
      &lt;/div&gt;
    );
  };
  
  export default App
  </code></pre>
  <p><strong>Income.js :</strong></p>
  <pre><code>
  const Income = (props) =&gt; {
    const [input, setInput] = useState(0);
  
    const setInputHandler = (e) =&gt; {
      e.preventDefault();
      setInput(e.target.value);
      props.onChangeHandlerIncome(input);
    };
  
    return (
      &lt;div&gt;
        &lt;form onSubmit={setInputHandler}&gt;
          &lt;label&gt;
            Income
            &lt;input
              type=&quot;text&quot;
              name=&quot;name&quot;
              onChange={(e) =&gt; setInput(parseInt(e.target.value))}
            &gt;&lt;/input&gt;
          &lt;/label&gt;
          &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;&lt;/input&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    );
  };
  
  export default Income;
  </code></pre>
  <p>I have tried using prevState, and simply adding value to the sum and had the same result.</p>
  <p>Also console.logged the value : adding two similar numbers logged me this :</p>
  <p>**123 (which is the number i typed in)</p>
  <p>App.js:10 undefined**</p>
  <p>I appreciate any kind of help!</p>