title: How to Calculate the two Columns in Table in React?
body: <p>In Material Table, There are three columns, One is CashAdd , Expenses and Balance so I want to put the formula in Balance column like this :
  <strong>Balance = (CashAdd-Expenses)-previousBalance</strong> in Balance column
  So anybody please tell how to do in React with Hooks ?</p>
  <pre><code>    const [data, setData] = useState([
        {
          cashAdd:&quot;&quot;,
          Expenses:&quot;&quot;,
          BalanceRs:&quot;&quot;
        }
      ]);  
  
  useEffect(() =&gt; {
  
    data.find((item)=&gt; {
      const balance = item.cashAdd -item.BalanceRs;
      //so how to find the last balance and calculate it
      //also how to update the state?
  
    })
  
  }, [])
  </code></pre>