Open Pannu786 opened 2 years ago
Howdy, this might be a bit late, but I just resolved this error.
In my case, the application would crash after pressing an operation button then throw this error. That got me thinking that it must have something to do with the operation buttons, so that lead me to OperationButton.js. In that file I noticed that when defining the type, I had mistakenly written "ACTIONS.ADD_OPERATION". This is a mistake because within the reducer function the action was actually called "ACTIONS.CHOOSE_OPERATION". Simply correcting this mistake fixed the error and my calculator runs smoothly.
Hope that helps!
Mine was correct but still showing the same error.
Mine was correct but still showing the same error.
I had the same reply. At my place it was on the reducer:
currentOperand: ${currentOperand || ''}${payload.digit}
I was missing 'state' before the 'currentOperand
currentOperand: `${state.currentOperand || ''}${payload.digit}`
this is how it should be.
Check if this is it for you otherwise - use diffchecker.com very useful for comparing code
Thanks for the help!!
Thanks for the help!!
Did you finish it?
Yes I was able to do it.
Mine was correct but still showing the same error.
I had the same reply. At my place it was on the reducer: currentOperand:
${currentOperand || ''}${payload.digit}
I was missing 'state' before the 'currentOperand
currentOperand: `${state.currentOperand || ''}${payload.digit}`
this is how it should be.
Check if this is it for you otherwise - use diffchecker.com very useful for comparing code
even after applying the change=> currentOperand: ${state.currentOperand || ''}${payload.digit}
mine was still showing the error "previousOperand and payload are defined but never used"
Hello folks
I am getting this error currentOperand undefine.. around 20: something at the video. Can someone help me out here?