Design comparison
SolutionDesign
Solution retrospective
The hardest part of this project was figuring out how to do the tip calculation. First I tried to make a function to do all the calculation there and then pass it to the handling functions, but when I tried it it didn't work because it used the previous state that it had been updated to. So the only way I found was to use a useEffect and that works perfectly. If anyone knows how to do it in another way please tell me. Thank u!
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord