Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Practice State in React!
You have completed Practice State in React!
Preview
Highlight the selected stars by conditionally rendering a class attribute.
Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
fill color by conditionally rendering
a class attribute for a list item.
0:00
When a user clicks on a star, each star,
up to the one that was clicked,
0:02
should be selected or highlighted by
changing its fill color with CSS.
0:07
In index.css,
I included a rule that targets a star
0:13
SVG inside an element with
the class selected and
0:18
changes its fill color to
a darker shade of blue.
0:23
This could be achieved
several different ways.
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up