Open Chaseknis opened 1 year ago
Hi @Chaseknis,
Your project is complete! There is nothing else to say other than... it's time to merge it :shipit: Congratulations! 🎉 !👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏!👏👏👏
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear. Please, remember to tag me in your question so I can receive the notification.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
The function
Calculator
returns aJSX
template and uses theuseState
hook to define a state object with propertiestotal
,next
, andoperation
, and initializes them with default values0
andnull
. Using theuseCallback
hook, TheonClickHandler
function takes an event and passes it to thecalculate
function along with the current state to update the state. The component then uses the destructuring assignment to extract thetotal
,next
, andoperation
properties from the state object and renders them as text. The component also defines a JSX template for a calculator UI, which includes buttons with numbers, operators, and other functions. Each button has anonClick
attribute that calls theonClickHandler
function.