0

I call this function on the button. How to calculate salary with one click. from this way it's need to click two times to calc salary with epf.

function addThem(cb){
      setEpf(0.08*salary);
      setTotal(salary+bonus+ot+mah-loan-advance-epf);
      cb();
    }
  • Does this answer your question? [The useState set method is not reflecting a change immediately](https://stackoverflow.com/questions/54069253/the-usestate-set-method-is-not-reflecting-a-change-immediately) – David Sep 26 '22 at 14:30

0 Answers0