score:2

it looks like an you are doing concat strings instead of number

i don't see add logic in your api request function but as per you showed you can fix it with below

let add = number(this.state.charge) + number(this.state.total);
console.log(add);

but important is you understand that the state you stored isn't number but typeof string.

so while updating state you can make sure it's number not an string so you don't need to convert it into number while doing concat.


Related Query

More Query from same tag