Open Moise-code opened 1 year ago
Hi @Moise-code,
Your project is complete! There is nothing else to say other than... it's time to merge it :shipit: Congratulations! 🎉
Cheers and Happy coding!👏👏👏
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
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.
In Math magicians project, I have used functional component and I was requested to provide explanation of it in this issue.
Functional components are basic JavaScript functions. These are typically arrow functions but can also be created with the regular function keyword.
they simply accept data and display them in some form; that is they are mainly responsible for rendering UI.
There is no render method used in functional components.
These are mainly responsible for UI and are typically presentational only (For example, a Button component).
I created a function component called calculator
I imported useState hook allowed me to create state variables for my component are used to store dynamic data in my calculator component which can change as a user interacts with the calculator.
my useState hook received an array composed of the initial state which in my case is "state" and the function to change the state which is "set State" in my case.
state have null values at first which in the end was changed by applying a number clicked to it which is "buttonName in my case".
the changes was save to a variable newState which assigned on the setSate function in the clickEvent function, which was called on the "onClick" event on the buttons in the return statement.