Eldonratzlaff / mathMagicians

0 stars 0 forks source link

Use React hooks #4

Open Eldonratzlaff opened 1 year ago

Eldonratzlaff commented 1 year ago

IMPORTANT NOTE: If you already use functional components, you can create a GitHub issue in which you describe how you use functional components and ask for a code review base on your issue.

I used the useState hook in line 5 to add a state variable to the Calculator component, the initial state is ({ total: null, next: null, operation: null, }); I update the state in line 10 with the calculate function (provided by microverse) with the current state and the string of the clicked button.

Finally, when the state has been changed, react detecs it and start a re-render of the calculator component, specifically the div in line 15.

Deepakdanger commented 1 year ago

Hi @Eldonratzlaff,

Status: Approved ✔️

Your project is complete! There is nothing else to say other than... it's time to merge it 🚢 Congratulations! 🎉

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.