I’m working on the jS Calculator and trying to do it with React but it’s like an hour that I’m trying to understand why my code doesn’t work. I think, the problem could be between line 98 and 109, because I tried to put a test button there, and in that case when I click it, the state is updated.
Here is the code:
Actually I forgot to reorder the code, and it was already done this part, now I fixed that.
My problem, specifically, is that I can’t understand why the handleNumber doesn’t take the e.target.value. I tried to console.log it, and it says that e.target.value isundefined.
Now I tried put a <button> isntead of a <div>, and it works like I want, but no, I have not yet understood why. I mean, it seems that a <div> element is not triggered by the onClick event. Right?