Current section: Prop Collections and Getters 30 exercises
solution

Prop Collections

Loading solution

Transcript

00:00 Let's go into the Toggler props, and right now it's just an empty object. Our job is to fill this with aria-checked and onClick. Aria-checked is whatever on is, which will be true or false, and onClick will be the function to update the clicked value.

00:16 We save that and everything is working. Our togglers are acting as togglers, and that is the desired behavior for our prop collection here. It's a collection of props that should be applied to the common use case being a toggler. Now, in Downshift, you've got

00:34 these collections of props for the input and for the menu, and for an item, and stuff like that. So it definitely gets more complicated than a toggle component like this one. But the idea is there are common use cases that people are using, and so let's give them a simple function

00:52 or a collection of props that they can apply for those common use cases. Good job.