Design comparison
Solution retrospective
Tricky part was changing the background of numbers when clicking on each of them, for some reason hover effect doesn't work. Any suggestions on fixing that are welcome! ✌🎉
Community feedback
- @PeshwariNaanPosted almost 2 years ago
Hello Nikola D - Nice job on completing the challenge.
A couple tips that might help:
-
The biggest advantage of using react is the ability to break up your code into components rather than keeping all your code in one file. This way you avoid unnecessary re-renders when something changes. For example, you could put your button in a separate file and map it in as a component. I know this project is very simple but if you use these practices now, more complex apps will be optimized and much easier to manage
-
Don't wrap buttons in a div. There is no advantage to doing this and it will cause you problems in the future, especially with accessibility. Make sure to put all the props like onClick with the button component, not on the div and just style the button directly. In the tailwind documentation you can see how they do it. You can also see how they apply the
active:
Pseudo-classe which makes changing the background after you click as simple as it gets. i.e.active:bg-orange-700
.
I hope this helps - Good luck and happy coding
Marked as helpful2 -
- @RMI11Posted almost 2 years ago
Hello there! 👋
Congrats for completing the challenge! I'm glad I can learn from you! 🙌
Happy holidays! 🎉✌
0 - @NikolaD93Posted almost 2 years ago
YouTube video of making this challenge 👉 https://www.youtube.com/watch?v=_8Gl5tKTde0&t=3041s
0
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