UPD: I gave made this work, cleaned up the possible bugs related to the data flows in react and now I am really intrigued by one single function of the Calculator: it does not perform division!
The rest such as clearAll, Decimal, addition, subtraction, equals all work perfectly, except the division. When I try to divide by a number, what I get is a ‘0’ in the answer section and then if I click on the ‘=’ ‘NaN’ is what I get as the result. I have tried converting the currentValue and nextValue that store values for performing this operation using parseFloat(), parseInt() etc but it does not seem to help.
Any ideas on how to get this moving?
I have been struggling with this challenge for a while. After following a handful of video tutorials and reading quite a few articles, I have managed to write something but it does not seem to work: https://codepen.io/Karajna/pen/XWjzmGm
Strangely, console messages I get tell me that ‘expression’ and ‘answer’, one of the two states of the Calculator app, are undefined. However I defined them within the this.state of the App component earlier.
Any ideas on how to make this work?