Submitted over 2 years ago
Interactive rating component using React and CSS Modules
@TimMartin13
Design comparison
SolutionDesign
Solution retrospective
Would a React context have been a better choice rather than prop drilling the rating functionality?
Community feedback
- @Ibarra11Posted over 2 years ago
One thing I did notice was that there is a bug in your code. The user can submit the button without having to chose a rating. You need to safeguard that scenario in your rateHandler function by putting a condition the state update only happens if rating is set to a value. As far as the prop drilling, I see you are passing the rating down multiple components, but I don't see it being used. I ran in it an online IDE and removed rating and the code worked as normal.
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