I’m working on the front end calculator challenge using react. Things were going swimmingly until I wanted to clear the display if the user enters a number after hitting equals. The logic seems sound, but the display doesn’t clear and the new number is added to the operand:
I think the problem is on lines 133-137. As far as I can tell React doesn’t update state fast enough to use in this calculation. Is that the correct interpretation?
- Should I use another method to store the key variables, and maybe just update display with state?
- Is there a way to make React update state faster?
Keen to understand rather than just botch my way through.
Thanks in advance!