Design comparison
SolutionDesign
Solution retrospective
With this challange I learned by myself how to use hooks on rendered objects from a .map() method:
<div className="rating-numbers animate__animated animate__bounceInRight">
{[...Array(5)].map((number, index) => {
index += 1;
return(
<button
type="button"
key={index}
className={index === rating ? "number-on" : "number"}
onClick={() => setRating(index)}
>
{index}
</button>
)
})}
</div>
Also, as you can see in the snipet above, I learned how to use the classes in the Animte.css package by reading its documentation.
Community feedback
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