title: my date and amount is not getting updated on api is being updated as empty string
body: <p>In my code, <code>date</code> and <code>amount</code> is not being updated. I have entered the value in post method but its getting updated as an empty string. Can anyone suggest me a solution?
  Here is my code of checkout form:</p>
  <pre><code>  const Checkout = () =&gt; {
        const [users, setUsers] = useState([]);
        const [name, setName] = useState(&quot;&quot;);
        const [location, setLocation] = useState(&quot;&quot;);
        const [date, setDate] = useState(&quot;&quot;);
        const[amount,setAmount]=useState(&quot;&quot;)
        let today = new Date()
      let Currdate = today. getDate() + '-' + parseInt(today. getMonth() + 1) + '-' + today. getFullYear()
      
        const postData = (e) =&gt; {
          axios
            .post(&quot;http://localhost:3003/order&quot;, {
              name,location,date,amount
            })
            .then((res) =&gt; {
             
              setUsers([
                ...users,
                {
                  id: res.data.id,
                  name: res.data.name,
                  location: res.data.location,
                  date: Currdate,
                  amount: total,
                },
              ]);
            },);
        };
          const state = useSelector((state) =&gt; state.addItem)
      
          var total = 0;
          const itemList = (item) =&gt; {
              
              total = total + item.price;
              return (
                 .....
              );
          }
      
    return (
       &lt;&gt;
    {state.map(itemList)}
    &lt;strong&gt;Rs.{total}&lt;/strong&gt;
    &lt;form className=&quot;card p-2&quot;&gt;
   &lt;input onChange={(e) =&gt;setName(e.target.value)}  value={name}/&gt;
    &lt;input onChange={(e) =&gt; setLocation(e.target.value)}  value={location}   /&gt;                           &lt;/&gt;
  export default Checkout
  </code></pre>