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

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…

Contents