From the course: React for Web Designers
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Challenge: Activate the color selector - React.js Tutorial
From the course: React for Web Designers
Challenge: Activate the color selector
(bright music) - [Instructor] At this point, we have a series of components that work pretty nicely together. But now it's time for our first challenge where you're going to be working on one of these components yourself. Right now, we have a size selector that can update the selected colors. We're going to do the opposite for this challenge. That is when we select color, we want to update the state of everything else accordingly. So here we are in our color selector challenge. What we're going to do is activate the color selector's behaviors, specifically, we're going to update the currently selected color, and then we're going to check the inventory, and update the size selector with the available sizes for the currently selected color. I have a little bit of extra credit in this challenge as well, which is to update the selectors by current availability. So what I mean by that is we'll check if the currently selected size is available for the currently selected color. So, if for…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Installing React on an existing site8m 7s
-
(Locked)
Identifying your components and data3m 19s
-
(Locked)
Set up first simple component5m 31s
-
(Locked)
Start using JSX with the help of Babel7m 57s
-
(Locked)
Attaching a data source3m 20s
-
(Locked)
Create a new component with array data5m 56s
-
(Locked)
Implement props4m 28s
-
(Locked)
Implement state with the useState hook5m 11s
-
(Locked)
Add the color selector component3m 27s
-
(Locked)
Change options, see reactions6m 14s
-
(Locked)
Challenge: Activate the color selector1m 58s
-
(Locked)
Solution3m 4s
-
(Locked)
-
-
-