Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive rating component using React, TailwindCSS and Redux

P

@TechGuySaad

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Community feedback

@Paulo-Dandrea

Posted

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 helpful

0

P

@TechGuySaad

Posted

@Paulo-Dandrea Are you suggesting using a map function on the buttons? Also what do you want me to componetize?

0

@Paulo-Dandrea

Posted

Sorry 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 GitHub
Discord logo

Join 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