Interactive rating component using React, TailwindCSS and Redux
Design comparison
Community feedback
- @Paulo-DandreaPosted over 1 year ago
Very nice solution using Redux and Router. It was very clarifying for me. This challenge is very good train that.
For the buttons on Rating.jsx, don't you think using a .map() would be cleaner? Less repeatable? Also, could be a good idea to componetize that. I think. What do you think?
Anyway, I'm favoriting here to help me with Redux or Router if I would use later.
Marked as helpful0@TechGuySaadPosted over 1 year ago@Paulo-Dandrea Are you suggesting using a map function on the buttons? Also what do you want me to componetize?
0@Paulo-DandreaPosted over 1 year agoSorry for the very late response, @TechGuySaad.
If you have 5 button-stars with almost the same code, you could componetize those buttons and call them on a map function.
function RatingButton({ rating }) { return (<button>{rating}</button>) } function Rating () { const ratings = [1, 2, 3, 4, 5]; return (<> { ratings.map( rating => </> } </> }
-- Something along theses lines, got it?
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