title: counter does not increment or decrement react
body: <pre><code>import React, { useState } from 'react';
  
  
  const Quantity = ({ todo }) =&gt; {
    const [count, setCount] = useState(+todo.count);
    function decrementCount() {
      setCount(count - 1)
      updateCount(count - 1)
    }
  
    function incrementCount() {
     setCount(count + 1)
     
     updateCount(count + 1)
   }
  
    // edit count function 
  
    const updateCount = async (newCount)  =&gt; {
      console.log(&quot;this is the newCount&quot;, newCount)  
  
    
    try {
       const body = { &quot;newCount&quot; : newCount}
       const response = await fetch(
        `http://localhost:5000/todos/${todo.todo_id}`,
         {
           method: &quot;PUT&quot;,
           headers: { &quot;Content-Type&quot;: &quot;application/json&quot; },
           body: JSON.stringify(body)
         }
       );
      
    
  
       window.location = &quot;/&quot;;
      } catch (err) {
        console.error(err.message);
         
      }
     }
  
  
   return (
    &lt;&gt;
      &lt;button onClick={() =&gt; decrementCount(todo.todo_id)}&gt;-&lt;/button&gt;
      &lt;span&gt;{count}&lt;/span&gt;
      &lt;button onClick= {() =&gt; incrementCount(todo.todo_id)}&gt;+&lt;/button&gt;
      &lt;/&gt; 
    )
    }
    
  
  export default Quantity;
  </code></pre>
  <p>I have created a counter app, however I am unable to get the incrementer and decrementer to work correctly, I have tried so many different things. Currently, whenever I change the count, the &quot;items&quot; in the description column gets deleted. I do not understand how this is happening. I have my current folder for this project on my github under fruitlist version 2 on my github</p>