@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
@TechGuySaad
Posted
@Paulo-Dandrea Are you suggesting using a map function on the buttons? Also what do you want me to componetize?
@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?